snee
how to split blog post to 5 pages with next and previous
Graham
snee You add this special xtscript function in a code block above the blog function
<!--parser:xtscript-->
# Paging function
function paging_template $url;$page;$active_page;$total_pages;
# Only one page so exit
if $total_pages == 1
return
endif
# Paging container
if $page == 1
print <div class="custom_paging">
endif
# Previous
if ($page+1) == $active_page
print <a href="$url">prev</a>
endif
# Next
if ($page-1) == $active_page
print <a href="$url">next</a>
endif
if $page == $total_pages
print </div>
endif
endfunction
<!--/parser:xtscript-->
Copy code how many items per page is set in the blog function
snee
Graham thanks for the code.but i need to add pagin function inside my post.i don't want to show full blog post in one page.
Graham
snee the only ways I can think of is either javascript or if the blog is in xtscript you can just use the custom paging tags
http://syntax.xtgem.com/manual/xtgem/default?func=paged_content
snee
Graham i already try that code in the link it didnt work
Graham
snee It does work if your blog is output via xtscript although that really requires a slightly custom twig just to protect $ and () in the blog posts and comments