Prints the values of pagination tools as hidden input fields.

Kuvaus

Pagination tools can be implemented with the <form> element with the action="{CurrentURL}" and method="GET" attributes.

Syntaksi

{PaginationFormParameters(
    name: string
)}

Näkyvyys

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

name:

You can use this attribute to select the list properties that should be printed as hidden <input> fields in connection with the product list.

Allowed values:

  • 'keyword': displays the search term, if set
  • 'per_page': displays the number of products displayed on one page
  • 'sort': displays the sorting criterion

If you want to give multiple values to the attribute, separate them with pipes. E.g. name: 'keyword|per_page|sort' is used by default.

after/before:

By using the after and before 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 and before 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.'