fn: paginate
[contents]

Contents

Syntax

The syntax for paginate calls is:

f++:  
paginate

n++:  
@paginate

Description

The paginate function is for specifying with pagination where to insert pages in to the file being built, it takes zero parameters.

Note: The hard-coded constants available for pagination are listed here.

See here for some blog templates which use pagination for the posts table, specifically see here (demo) for an example of pagination code.

n++ example

Example of paginate being used with n++:

@paginate

@paginate.no_items_per_page(2)

@paginate.template
{
	<p>
		@if{!s}($[paginate.page_no] > 1)
			<a href="@pathtopageno(@`$[paginate.page_no]-1`)">previous</a> 
		@if{!s}($[paginate.page_no] < $[paginate.no_pages])
			<a href="@pathtopageno(@`$[paginate.page_no]+1`)">next</a>
	</p>

	$[paginate.page]
}

@item
{
	<p>
		item 1
	</p>
}
@item
{
	<p>
		item 2
	</p>
}
@item
{
	<p>
		item 3
	</p>
}
@item
{
	<p>
		item 4
	</p>
}

Sponsors