Jump to:

3439 Posts in 1028 Topics by 869 members

Template Questions

SilverStripe Forums » Template Questions » find page siblings within <% control Children %>

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

Page: 1
Go to End
Author Topic: 1271 Views
  • patte
    Community Member
    63 Posts

    find page siblings within <% control Children %> Link to this post


    perhaps someone can help me to find a way to link to an element sibling regardless of where I am.

    I want to display multiple pages on one webpage - navigating with a javascript scroller, like http://demos.flesler.com/jquery/localScroll/

    Using the navigation, everything works fine but building the pager within those child elements seems to be complicated.

    <% control Children %>
    <div class="section">
          <li class="sub" id="$URLSegment">
             <h1>$URLSegment - Headline</h1>
    <%-- PREV SIBLING NEXT --%>   
    <% end_control %>

    Any Idea?

    Thanks much in advance

  • swaiba
    Forum Moderator
    1788 Posts

    Re: find page siblings within <% control Children %> Link to this post

    Totally untested or reasearched idea, but why not try getChildrenAsUL(), partialTreeAsUL() or SiteTreeAsUL() to get you the UL straigh away?

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.