Jump to:

23471 Posts in 18941 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Show Content from 2 pages

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: 613 Views
  • Bereusei
    Community Member
    94 Posts

    Show Content from 2 pages Link to this post

    i´ve a little question. I have an menu with an submenu. Each item has several pages.
    An example:
    About us -> People -> Page 1
    About us -> People -> Page 2

    If I sit on page "People" I wanna get the content from Page 1 and 2 in HTML.

    Here is my code:

    <% if Children(1) %>    
    <div class="text"></div>
    <div id="Pagination"></div>
    <div id="hiddenresult" style="display:none;">

    <!--This part of the code should repeat if there are more than two pages
    at the first time $content should be content of page 1
    at second time $content should be content of page 2-->
    <% control children(1) %>
    <div class="result $firstlast">
    <% end_control %>

    <% else %>

    <div class="text">
    <% end_if %>

    I hope it´s clear what I´m wanna do. Can anyone help?

  • Ryan M.
    Community Member
    309 Posts

    Re: Show Content from 2 pages Link to this post

    Did you test that code? Looks like it should work. Don't forget $content should be $Content.

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.