Reputation: 2308
Just as title, how can I place multiple pagination widgets on the same page with Algolia Instant Search? Simply put I'd like to have a pagination right at the top of the results and another one at the bottom.
I tried giving as container
an array via document.querySelectorAll('.pagination')
instead of a single element, unfortunately it doesn't work returning error in console
Error: Container must be
string
orHTMLElement
.
Upvotes: 2
Views: 739
Reputation: 2319
To add multiple instances of the instantsearch.js pagination widget you just need to add it several times to your instantsearch instance:
search.addWidget(
instantsearch.widgets.pagination({
container: '#pagination-container-1'
})
);
search.addWidget(
instantsearch.widgets.pagination({
container: '#pagination-container-2'
})
);
Upvotes: 4