Products Per Page
Products Per Page controls let users choose how many results appear on each page. Choose a native select, custom dropdown, or always-visible list.
Documentation
Products Per Page is a family of three elements that allow you to set the number of products to be shown on a page.
ff-products-per-page-selectis a native HTMLselectelement.ff-products-per-page-dropdownis a custom-built dropdown element.ff-products-per-page-listshows a list with all options always visible.
All three elements can be used with or without additional customization.
Defining available options
All three elements have a values attribute that must be set. With this attribute, you specify which page sizes shall be available in the element.
<ff-products-per-page-list values="20,40,80,160"></ff-products-per-page-list>Make sure to specify a value that is equal to the default page size that you configure in the FactFinder UI.
If FactFinder returns a page size that is not in the values attribute, an additional list item will be created.
Native HTML select (ff-products-per-page-select)
The code below will display a native HTML select. You can optionally specify an option template. If not specified, it will default to <option>{{value}}</option>.
<ff-products-per-page-select values="12,24,36">
<option>Show {{value}} products per page</option>
</ff-products-per-page-select>Rendered HTML
When set up like in the example above, the rendered HTML could look like this.
Custom-built dropdown (ff-products-per-page-dropdown)
The ff-products-per-page-dropdown is a custom-built dropdown. If no ff-products-per-page-item is provided as template, it will default to <ff-products-per-page-item>{{value}}</ff-products-per-page-item>.
Rendered HTML
When set up like in the example above, the rendered HTML could look like this.
Products per page as list (ff-products-per-page-list)
You can also display products per page in the fashion of a radio button list with ff-products-per-page-list.
If no ff-products-per-page-item is provided as template, it will default to <ff-products-per-page-item>{{value}}</ff-products-per-page-item>.
Rendered HTML
When set up like in the example above, the rendered HTML could look like this.
Demo
API
ff-products-per-page-select
Properties
values (String) (required)
A comma-separated list of page sizes.
Events
dom-updated
This event is triggered when the element has received new data and the template for this element and all sub elements have been punched out.
ff-products-per-page-dropdown
Properties
values (String) (required)
A comma-separated list of page sizes.
show-selected (Boolean)
Determines if the selected ff-products-per-page-item is also shown in its source list.
opened (Boolean)
(Not intended for manual use.) Set automatically when the dropdown opens. Use it for styling.
collapse-onblur (String) Options: "true", "false" (default: "true")
Determines if the element closes automatically after losing focus.
Methods
toggle(expand?: Boolean)
Opens or closes the element, based on its current state.
expand()
Expands the dropdown element.
collapse()
Collapses the dropdown element.
Events
dom-updated
This event is triggered when the element has received new data and the template for this element and all sub elements have been punched out.
ff-products-per-page-list
Properties
values (String) (required)
A comma-separated list of page sizes.
Events
dom-updated
This event is triggered when the element has received new data and the template for this element and all sub elements have been punched out.
Last updated
Was this helpful?