The pagination is set by entering the default number of items per page for the given section (can be optionally also set via a message that we slip in the "startup" function
public $paginationDefaults = [
'products' => 10
];
HomepagePresenter -> global variable: Polák nábytek
Next, you need to set pagination for the data. This is done by sending the following data to the paginate function: items -> Selection, current number of items per page -> Number, whether it is a queue -> Bool, default number of items per page -> Number
$products = $this->paginate($products, $this->perPage->products['value'], true, $this->paginationDefaults['products']);
Paginate function -> product pagin setting per category: Polák nábytek
For the correct functioning of the function "load more items" it is necessary to set a reference to the handle "paginationMore", which contains 2 parameters: name -> name, which we enter into the default pagination field see the 1st picture, url -> another url, which is empty by default, but in case of special pages it is necessary to set the url separately.
For example, the "load more" link is as follows, see image below.
<a class="pagination__button-more button button--text button--arrow button--down ajax" role"button"
n:href="paginationMore! 'name' => $name, 'url => $url">
{$more}
</a>
Link to load more -> latte: Polák nábytek
When using ajax to load multiple items on a page, the "pagination_snippet" snippet is automatically redrawn