Jump to:

23477 Posts in 18941 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Go to previous page / next page

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

    Go to previous page / next page Link to this post

    Hallo folks,

    I have used this tutorial http://www.ssbits.com/tutorials/2009/creating-previous-and-next-buttons-on-a-page/.
    But it doesn´t work how I want. I want that you can only switch between Subsubpage 1 and 2 (see example of the sidetree)

    - Page 1
    - - Subpage 1 <- prev/next buttons are placed here
    - - - Subsubpage 1
    - - - Subsubpage 2

    - - Subpage 2
    - - Subpage 3

    If I click on subsubpage2 on the next button, I jump to the startpage.
    If I´am on subsubpage 2 to next button must not be shown.
    Is it possible to set an if-statement for the control?

    <% if nextpage or something %>
    <% control PrevNextPage(next) %>
    <a href="$Link" title="Go to $Title">next page</a></ br>
    <% end_control %>
    <% end_if %>

    How can I check, if there is an "next-page" ?

    Thanks for help.

  • Bereusei
    Avatar
    Community Member
    94 Posts

    Re: Go to previous page / next page Link to this post

    I´ve found the solution:

    <% control PrevNextPage(prev) %>
    <% if LinkOrCurrent = link %>
    <a href="$Link" title="Go to $Title" class="$LinkingMode"> < </a></ br>
    <% end_if %>
    <% end_control %>

    <% control PrevNextPage(next) %>
    <% if LinkOrCurrent = link %>
    <a href="$Link" title="Go to $Title" class="$LinkingMode"> > </a></ br>
    <% end_if %>
    <% end_control %>

    That works fine!

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