For the complete documentation index, see llms.txt. This page is also available as Markdown.

Products Per Page

Let shoppers choose how many products each page shows.

Documentation

Overview

This element lets users set the number of products shown per page. FactFinder backend defines the available options.

  • ff-products-per-page-select is a native HTML select element.

  • ff-products-per-page is a custom-built dropdown element.

  • ff-products-per-page-list shows a list with all options always visible.

All three elements can be used with or without additional customization.

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>
    <option data-template>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.

<ff-products-per-page-select>
    <select>
        <option>Show 12 products per page</option>
        <option>Show 24 products per page</option>
    </select>
</ff-products-per-page-select>

Custom-built dropdown (ff-products-per-page)

ff-products-per-page is a custom-built dropdown. If no ff-products-per-page-item template is provided, it defaults 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 a products per page handle as a horizontal 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>.

Demo

API code

ff-products-per-page-dropdown

Properties

Properties
Name
Description

show-selected (String) Options: "true", "false" (default: "false")

Shows the selected item in the source list.

opened (Boolean) (default: false)

Indicates whether the dropdown menu is open.

collapse-onblur (String) Options: "true", "false" (default: "false")

Determines whether the element closes when it loses focus.

items (Array)

FactFinder data.

Methods

Methods
Name
Description

toggle(collapse?: Boolean)

Opens or closes the element based on its current state.

show()

Opens the dropdown element.

hide()

Closes the dropdown element.

Events

Events
Name
Description

dom-updated

Triggered when the element receives new data and templates render.

ff-products-per-page-list

Events

Events
Name
Description

dom-updated

Triggered when the element receives new data and templates render.

ff-products-per-page-item

Properties

Properties
Name
Description

products-per-page-item (Object) (default: empty)

The required data object from FactFinder.

Rendered HTML

When set up like in the example above, the rendered HTML could look like this.

Last updated

Was this helpful?