Search

Filters

Search filters are taxonomy controls inside a {{ search }} form, so readers can narrow the query from the page.

Basic Shape#

Put {{ filter:{taxonomy} }} inside the search form, then bind the query with search.

phpresources/views/front-page.php
{{ search auto }}  <input type="search" placeholder="Search">  {{ filter:category type="select" }}{{ /search }}{{ query:posts search }}  <h2><a href="{{ url }}">{{ title }}</a></h2>{{ /query:posts }}

The filter belongs to the search form. The query only needs search; TemplateX reads the selected filter values from the matching form.