Jump to:

3397 Posts in 978 Topics by 854 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: 1192 Views
  • patte
    Avatar
    Community Member
    63 Posts

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

    Hi,

    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">
       <ul>
          <li class="sub" id="$URLSegment">
             <h1>$URLSegment - Headline</h1>
             $Content
    <%-- PREV SIBLING NEXT --%>   
          </li>
       </ul>
    </div>
    <% end_control %>

    Any Idea?

    Thanks much in advance
    patte

  • swaiba
    Avatar
    Forum Moderator
    1769 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?

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