Description
The paginate tag is responsible for pagination within the LocomotiveCMS engine. It is currently applicable to the entries of content types.
It can be combined with the with_scope tag.
Syntax
{% paginate contents.projects by 10 %}
<loop>
{% endpaginate %}
Example
{% paginate contents.projects by 10 %}
{% for project in paginate.collection %}
{{ project.title }}
{% endfor %}
{% endpaginate %}
Properties of the paginate object
Name | Type | Description |
---|---|---|
collection | Array | list of elements |
current_page | Integer | the index of the current page |
previous_page | Integer | the index of the previous page. Nil if there is no previous page |
next_page | Integer | the index of the next page. Nil if there is no next page |
total_entries | Integer | total number of entries |
per_page | Integer | number of entries per page |
total_pages | Integer | total number of pages |
parts | Array | list of all the parts which make up a good navigation for this pagination. Each element will have any of these three elements: title (String), url (String), is_link (Boolean). |
previous | String | url to the previous page. Nil if there is no previous page |
next | String | url to the next page. Nil if there is no next page |