Searchable list (URL filters)

A collection list driven by the address: a search box that submits as you type, category chips from the collection's facets, a result count and page links.

queryquery_metarequest.queryfacetsautosubmitsearchfilterlistcollectionunlessurl

About this block

Everything a visitor chooses lives in the address (?q=, ?category=, ?page=), read back as request.query and applied to the collection by one query read. Results can be bookmarked, shared and survive a reload, and the page works without scripting.

How to customize it

  • Change articles in the query key and in the facets filter to your own collection, and category to the field you filter by. The in= part lists the address parameters the read accepts.
  • limit= in the query key is the page size. The meta object carries totalCount, totalPages and page.
  • The search form carries data-autosubmit, so typing submits after a short pause. Remove it to submit on Enter only.

Browse other blocks

Same library cards — preview live and grab the code from any block.

View full library