Skip to content

r:page:next_sibling

Nathan Reckart edited this page Aug 1, 2014 · 1 revision

In CleanSlate, it is possible to access the previous and next pages relevant to the current page, based on page ordering, with the <r:page:previous_sibling> and <r:page:next_sibling> tags.

For example, you could create a pager to navigate through a set of sibling pages as follows:

<ul class="pager">
  <r:page:previous_sibling>
    <li class="previous"><a href="<r:page:url />">&larr; <r:page:name /></a></li>
  </r:page:previous_sibling>
   
  <r:page:next_sibling>
    <li class="next"><a href="<r:page:url />"><r:page:name /> &rarr;</a></li>
  </r:page:next_sibling>
</ul>

NOTE: This functionality is dependent on the 'Sort order' property of the sibling pages. Each sibling page should have a unique sort order value. Pages with the same sort order value may behave unexpectedly when using the <r:page:previous_sibling> and <r:page:next_sibling> tags.