Jump to:

3439 Posts in 1028 Topics by 869 members

Template Questions

SilverStripe Forums » Template Questions » Limit <% control %> items

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1093 Views
  • carlo
    Avatar
    Community Member
    5 Posts

    Limit <% control %> items Link to this post

    Hey

    How can I limit control-items in my .ss template, in my case an image-gallery-images (for example, limit to 2 items)?
    I tried following without result:

    <% control NewsImages(2) %>
       $Attachment.croppedImage(100,100)
    <% end_control %>

  • biapar
    Avatar
    Forum Moderator
    435 Posts

    Re: Limit <% control %> items Link to this post

    In your function "newsimage"e you need to limit your for loop.
    At your function passing upper limit number.

    1093 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.