x
 
Create New Page
 View Previous Changes    ( Last updated by Lisa Wess )

Next and Previous on all pages with pagination

How to show “Previous” and “Next” on all pages with pagination, including the very first and last ones

The following code will show “Previous” and “Next” on all pages with pagination, even if the user is on the very first or last page and there are, in fact, no further links:

{paginate}
{if {current_page}
== 1}
Previous
{
/if}
{if previous_page}
<a href="{auto_path}">Previous</a>
{/if}
{if {current_page}
== {total_pages}}
Next
{
/if}
{if next_page}
<a href="{auto_path}">Next</a>
{/if}
{
/paginate}

Category:Templates

Categories: