Search

Filter Options

Search filter options control the generated taxonomy controls and how term lists are loaded.

Options#

OptionValuesWhat it does
typeselect, checkbox, radio, pillChooses the generated control type.
show_countbooleanShows the post count beside each term.
showCountbooleanSame as show_count.
hide_emptybooleanHides terms with no posts.
hideEmptybooleanSame as hide_empty.

Boolean options can be written without a value:

php
{{ filter:category type="select" show_count hide_empty }}

Default Behavior#

If no type is given, TemplateX renders checkbox inputs.

php
{{ filter:category }}

The generated controls use the taxonomy slug, the term slug, and URL parameters. They do not add theme styling for you.

Filters inside a search form make the form enhanced, even when auto is not written:

php
{{ search }}  {{ filter:category type="radio" }}{{ /search }}

Changing the filter updates the URL and refreshes the matching query results.