Polly po-cket
Home

Paged Content with Next and Prev Buttons



So this is a tutorial on "How to create Paged Content on XTgem which will only have the Prev and Next Buttons without any link with page numbers.

Here's an Example:
Here will be the content of Landing Page, the first page that the user will see which is page no. 1. It starts within the <!parser:xt_pagination> and ends with <!--/parser:xtscript-->
Next

<!--parser:xt_pagination-->
Here will be the content of Landing Page, the first page that the user will see which is page no. 1.
<!--parser:xt_page_split-->
Here will be content of the Next Page or Page no. 2
<!--parser:xt_page_split-->
This is the third page to be seen by your visitor or page no. 3
<!--parser:xt_page_split-->
And it will go on like this as many time as you want until you stop the pagging funtion by placing the code below:
<!--/parser:xt_pagination-->

<!--parser:xtscript-->
# Paging function
function paging_template $url;$page;$active_page;$total_pages; 
# Only one page so exit
if $total_pages == 1
goto @end
endif
# Paging container
if $page == 1
print <div class="" style="margin:4px auto;text-align:center">
endif
# Previous 
if ($page+1) == $active_page
print <a class="xt_button" href="$url">Prev</a>
# Next 
elseif ($page-1) == $active_page 
print <a class="xt_button" href="$url">Next</a>
endif
if $page == $total_pages
print </div>
endif
@end
endfunction
<!--/parser:xtscript-->
    

Related Pages: