Search Filters

Categories

Component ID

2905755

Component name

Search Filters

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Component created

Component changed

Component body

Search Filters allows you to assign taxonomy terms to content types and use them for filtering search results.

Its most common use case is:

1. Create nice SEO-friendly categories describing your content as a taxonomy vocabulary.
2. Create a field for selecting which category value applies to each piece of content.
3. Hide the field on the form settings for any content types you wish to manage automatically.
4. Assign entities and bundles to those terms in the Bundle Mapping configuration of Search Filters.

An example bundle mapping might look like this:

commerce_product:accessory:Accessories
commerce_product:product:Products
commerce_product:consumable:Accessories
node:article:[field_article_type]
node:career:Careers
node:case_study:Case studies
node:form_page:Forms
node:landing_page:Information Pages
node:testimonial:Testimonials

You can also use wildcards in the bundle specification, such as:

node:*:Pages

This would apply the Pages value to all nodes regardless of bundle.

Now, anytime you save a node which has a valid mapping, its correct term(s) will be selected. You can now use these terms for filtering your content, or visually displaying the content's category somewhere.

You can get some of these same benefits simply by setting a default value on the term reference field for all entity types and hiding the field in forms. But the issue is that it's then stuck with that default-assigned value until it's manually changed. With this module, you can reconfigure the settings anytime, and re-saving a node will set the correct currently-configured values.