Jump to:

23368 Posts in 18143 Topics by 2863 members

General Questions

SilverStripe Forums » General Questions » Split control loop into 2 columns/ footer menus/ multi column lists

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 1043 Views
  • CHD
    Avatar
    Community Member
    218 Posts

    Split control loop into 2 columns/ footer menus/ multi column lists Link to this post

    Hi all,

    not sure if this is the BEST way to do it, but i just spent half an hour searching the forums and have managed to put this together, so thought i'd share!

    i wanted to list some items in a footer menu, using control of page URL.
    but there were too many for one column, so i wanted to split the list.

    here's what i did:

    <dl>
       <dt>Properties</dt>

             <% control Page(properties) %>
             <% control Children %>

       <dd> <a title="$Title" href="$Link">$Title</a></dd>

             <% if Pos = 4 %>
    </dl>
       <dl>
             <% end_if %>
    <% end_control %>
    <% end_control %>
    </dl>

    so now, it lists 4 items, then closes the list and starts a new one, then continues the control loop.
    once it runs out of items to list, it closes and ends.

    works perfectly for my needs!

    but if anybody knows a cleaner solution please do share.

    1043 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.