ez.no / ezpublish / documentation / customization / custom design / pagination
These documentation pages are no longer maintained. Please visit the new documentation site.
A simple object list is good for small lists, but not very efficient if we have many objects in a folder. We would then like to break up the list and for example only show the 10 latest objects and have navigation possibilities to see the other objects. The navigator itself is just a template we include that takes some parameters.
Example:
{let numberOfObjects=10} {let articleCount=fetch( 'content', 'list_count', hash( 'parent_node_id', $node.node_id ) )} {let articleList=fetch( 'content', 'list', hash( 'parent_node_id', $node.node_id, 'sort_by', $node.sort_array, 'offset', $view_parameters.offset, 'limit', $numberOfObjects ) )} {section name=articleLoop loop=$articleList} {node_view_gui view=element content_node=$articleLoop:item} {/section} {include name=navigator uri='design:navigator/google.tpl' page_uri=concat( '/content/view/full/', $node.node_id, '/' ) item_count=$articleCount view_parameters=$view_parameters item_limit=$numberOfObjects} {/let} {/let} {/let}
As you can see, we do two fetches. First we fetch the total number of objects on the current position in the tree. Next we fetch only 10 articles and print these as normal. In the end of the list we will make the navigator. This is done by including one of the navigator templates (or by creating a new one). Two navigator templates are supplied, templates/navigator/simple.tpl and templates/navigator/google.tpl. simple.tpl is, as the name says, a very simple navigator you can use as an example to build your own, and google.tpl is a navigator with a design inspired by Google.
The navigator takes several parameters:
|
Parameter |
Description |
|---|---|
|
name |
A name to identify the navigator |
|
uri |
The placement of the template file |
|
page_uri |
The URL to the current list |
|
item_count |
Total number of objects in the list |
|
view_parameters |
The array containing the view parameters |
|
item_limit |
Number of objects on each page |
Comments
page by letters instead of numbers
Douglas Hammond
Wednesday 01 March 2006 6:18:51 pm
Eg. by title's
multiple navigators on one page
Vaskin Kissoyan
Monday 12 July 2004 4:07:11 pm