Prints a drop-down menu for selecting the number of products that should be displayed on a single list page.
Kuvaus
- If product filters are in use, the options in the menu will be defined in the theme's theme.xml configuration file.
- If product filters are not in use, the options are determined by the product list tag's
limit
attribute.
Pagination tools can be implemented with the <form>
element with the
and action=
"{CurrentURL}"
attributes.method=
"GET"
Read more about implementing pagination tools on product lists.
Syntaksi
{PaginationLimit}
Näkyvyys
Toimii näkyvyydessä: tuote
This tag is always used in connection with product list tags (e.g. {Products}
).
Implementing pagination tools for product lists
In the example below, we discuss the implementation of pagination tools in MyCashflow's default theme.
{Products(
pagination: true,
classes: 'first||',
limit: '30|15|60|90',
sort: 'manual|name_asc|released_desc|price_asc',
before: '
<form action="{CurrentUrl}" method="get" id="PaginationSortForm">
{PaginationStatus}
<div class="FormItem GroupItem">
{PaginationFormParameters(
name: 'keyword'
)}
<div>
{PaginationSort}
</div>
<div>
{PaginationLimit}
</div>
<div>
<button type="submit">{%Send}</button
</div>
</div>
</form>
',
after: '{PaginationPages(items: 7)}',
helper: 'helpers/listproduct'
)}
Pagination tools are implemented as a form with the relevant page's address as its action
attribute.
First, the pagination status is printed (which page the user is currently visiting) by using the {PaginationStatus}
tag.
Next, pagination parameters, i.e. ... , are printed by using the {PaginationFormParameters}
tag.
The menus for sorting and filtering the product list are printed by using the {PaginationSort}
and {PaginationLimit}
tags. The values available in the menus are based on the sort
and limit
attributes' values.
Attribuutit
after/before:
By using the
after
andbefore
attributes you can define content that is output either after or before the tag's output.Allowed values:HTML and Interface markup.
E.g.
before:
'<p>Tämä merkkaus näkyy ennen tagin omaa sisältöä.</p>'after:
'<p>Tämä taas näkyy tagin oman sisällön jälkeen.</p>'
If the tag does not produce any content, neither the content of the
after
andbefore
attributes will be output.escape:
Adds an escape character before quotation marks in the output.
The attribute makes it easier to process the tag-produced content when using JavaScript.
Allowed values:true/false. The default value is false.
or:
Defines alternative content that is displayed if the tag itself does not produce any content.
Allowed values:HTML and Interface markup.
E.g.
or:
'Sisältöä ei löytynyt.'