Filters Data Source Overview
Complete guide to data sources available in Radio, Select, Checkbox, and Search filters’ settings of the JetSmartFilters plugin.
Taxonomies Source
The “Taxonomies” Data Source is available in the settings of Select, Radio, and Checkbox filters.
This source allows populating the filter options with a list of terms (categories or tags) and using them to filter by.
For instance, we have a post type called “Properties” and an associated taxonomy called “Property Type”. Using the “Taxonomies” Data Source, we can filter posts of the “Properties” post type by terms of the “Property Type” taxonomy.
Our taxonomy has five categories: “Bungalow”, “Cottage”, “House”, “Resort”, and “Villa”.
To filter posts by these terms, the “Taxonomy” Data Source should be selected in the filter settings.
As a result, the filter will be populated with the list of categories as filter options.
The list of settings for the “Taxonomies” Data Source includes:
- Taxonomy — in this drop-down menu, one needs to choose the taxonomy that will be used for filtering;
- Relational Operator — this feature is available in the Checkbox filter. It has two available options. The “Union” operator will display results corresponding to at least one of the selected checkboxes. For example, if “House” and “Villa” options are selected, items belonging to either category will appear. For the “Intersection” option, the result is vice versa. Only items that belong to both “House” and “Villa” options will be displayed;
- Show empty terms — if this toggle is on, the empty terms that have no items assigned to them will also be shown on the list;
- Show only childs of current term — on the parent category archive, only its child categories will be shown. On all other pages, all categories will be displayed;
- Group terms by parents — this option should be switched on to save the hierarchical structure where child terms are listed under the parent ones;
- Is Checkbox Meta Field (Jet Engine) — this option should be enabled to filter items by the Checkbox meta field saved as an array, Select meta field saved as multiple select, Posts meta field saved as multiple, or Checkbox meta field of ACF. This option is mainly used for filters with the Custom Fields source;
- Exclude/Include — is used to include or exclude some of the terms, so they will be or won’t be shown in the options list.
- Use Custom Query Variable — this setting is unrequired for the “Taxonomies” Data Source. This setting can be enabled to filter items related by the Relations feature of the JetEngine plugin. For example, if the given taxonomy is the child object or the parent object in a relation, it is possible to use this taxonomy for filtering the related objects. Follow another tutorial to find more information on how to filter related items.
Manual Input Source
The “Manual Input” Data Source is available in the settings of Select, Radio, and Checkbox filters.
This source allows completing the filter options manually.
In the Options List area, the options for the filter can be manually added. The Label field is the human-readable option name; it will be displayed to users on the front end. The Value field is the value that will be used in the filtering process. The filter will look for a match between the provided option value and filtered item values.
For instance, there is a “Checkbox” Meta field named “_facilities” created in a Custom Post Type called “Properties.” The meta field lists facilities that can be included in properties. There is a total of twenty facilities in the “Checkbox” Meta field, but we want to have only three of them in the filter — “Wi-Fi,” “Gym,” and “Dining Area.”
In this case, we need to copy the values of the “Checkbox” Meta field options to the options’ values in the filter.
The filter will look for a match between the values of the filter options and the values of the “Checkbox” Meta field and display those items in filter results where the match is found. If a property has a “Wi-Fi” option selected in the meta field, this property will be listed in filter results when the “Wi-Fi included” option is picked in the filter. However, it is not required to match the option labels.
The list of settings for the “Manual Input” Data Source includes:
- Is Checkbox Meta Field (Jet Engine) — this option should be enabled to filter items by the “Checkbox” Meta field saved as an array, “Select” Meta field saved as multiple select, “Posts” Meta field saved as multiple, or “Checkbox” Meta field of ACF;
- Query Variable — this setting is required. When filtering by a meta field, copy and paste the Name/ID of the meta field into the Query Variable field. For multiple field keys, separate them with commas.
Posts Source
The “Posts” Data Source is available in the settings of Select, Radio, and Checkbox filters.
This source allows populating the filter options with a list of posts from the chosen post type and using these posts to filter by. This Data Source is frequently used for filtering related items or filtering by a “Posts” Meta field.
The list of settings for the “Posts” Data Source includes:
- Post Type — in this drop-down menu, one needs to choose the custom post type that will be used for filtering;
- Is Checkbox Meta Field (Jet Engine) — this option can be enabled to filter items by the “Checkbox” Meta field saved as an array, “Select” Meta field saved as multiple select, “Posts” Meta field saved as multiple, or “Checkbox” Meta field of ACF. This option can be activated to filter posts by the “Posts” Meta field of JetEngine, which is saved as Multiple. If the Multiple switcher is disabled in the “Posts” Meta field’s settings, keep the Is Checkbox Meta Field setting disabled.
- Exclude/Include — here, the filter options list can be limited to those included with the Include option or exclude certain posts with the Exclude option.
- Query Variable — this setting is required. When filtering by a “Posts” Meta field, copy and paste the Name/ID of that meta field into the Query Variable field. When filtering by related items, select the “JetEngine” option in the list of query variables.
Custom Fields Source
The “Custom Fields” Data Source is available in the settings of the Select, Radio, and Checkbox filters.
This source allows filtering items by meta fields. Unlike the “Manual Input” Data Source, the “Custom Fields” Data Source does not require populating the filter options manually; it loads the data automatically from meta fields. This source works with “Checkbox,” “Radio,” and “Select” Meta fields.
The list of settings for the “Custom Fields” Data Source includes:
- Custom Field Key — in this field, the name of the meta field should be inserted;
- Get Choices From Field Data — the setting makes the filter populate the filter options from the options of the meta field;
- Field Source Plugin — the dropdown becomes available if the Get Choices From Field Data is enabled. The “JetEngine” option works with JetEngine meta fields, while the “ACF” option works with ACF meta fields;
- Is Checkbox Meta Field (Jet Engine) — this option can be enabled to filter items by the “Checkbox” Meta field saved as an array, “Select” Meta field saved as multiple select, “Posts” Meta field saved as multiple, or “Checkbox” Meta field of ACF;
- Query Variable — in this field, paste the name of the meta field that will be filtered.
For example, there is a “facilities” Checkbox Meta field created in a Custom Post Type to be filtered.
In this case, we need to copy the name of the meta field from the Name/ID field and paste it into the Custom Field Key and Query Variable settings of the filter.
To make the filter populate its options automatically, enable the Get Choices From Field toggle and select the “JetEngine” option as the Field Source Plugin. Since we filter by a “Checkbox” Meta field, Is Checkbox Meta Field (JetEngine) toggle should be enabled.
In the result, the filter will be completed with options from the meta field and will filter posts by these options.
JetEngine Custom Content Types Source
The “JetEngine Custom Content Types” Data Source is available in the settings of Select, Radio, and Checkbox filters. Requires the JetEngine plugin activated and its Custom Content Types module enabled.
This source allows filtering CCT items by their custom fields. Works with “Checkbox,” “Radio,” and “Select” custom fields.
The Query Variable field expects the custom field’s name from the settings of the Custom Content Type.
The filter will generate options automatically from the custom field provided in the Query Variable field.
JetEngine Glossary Source
The “JetEngine Glossary” Data Source is available in the settings of Select, Radio, and Checkbox filters. Requires the JetEngine plugin activated.
The source generates filter options based on a Glossary.
The list of settings for the “JetEngine Glossary” Data Source includes:
- Select glossary — the dropdown presents a list of all created glossaries. Select the glossary that will be filtered by;
- Is Checkbox Meta Field (Jet Engine) — this option can be activated to filter items by the “Checkbox” Meta field saved as an array, “Select” Meta field saved as multiple select, “Posts” Meta field saved as multiple, or “Checkbox” Meta field of ACF;
- Query Variable — this field is obligatory for completing the filter settings. Here, the Name/ID value of the meta field that uses the same glossary should be put. It will allow filtering Custom Content Type items, Custom Post Type posts, and users by Glossary values.
For example, in a Custom Post Type, there is a meta field of Checkbox type that gets options from a Glossary.
In this case, the Name/ID of that meta field is pasted into the Query Variable field in the filter settings. Also, we select the same Glossary and enable the Is Checkbox Meta Field (Jet Engine) toggle since the filtered meta field is a Checkbox meta field.
As a result, posts can be filtered by their selected Glossary options. Check our complete guide that explains how to set up a filter by Glossary step by step.
JetEngine Query Builder Source
The “JetEngine Query Builder” Data Source is available in the settings of Select, Radio, and Checkbox filters. Requires the JetEngine plugin activated.
This data source allows generating filter options from the results of a custom query. It is often used to filter posts by terms that should be ordered in a specific way. Or in case a user needs to generate filter options from a list of users with a particular value in their meta field. The number of possible use cases is limitless; this topic is covered in a more detailed guide on using custom queries as a filter source.
Unlike the taxonomy, posts, or other data sources of JetSmartFilters that let us choose just some post type, taxonomy, or CCT overall, the custom query can have a more specific set of clauses to represent only explicit posts, terms, CCT items, users, etc. as options of a filter.
The list of settings for the “JetEngine Query Builder” Data Source includes:
- Select Query — the dropdown presents a list of all created custom queries in the Query Builder tool of the JetEngine plugin. It is possible to select a custom query of any type, including SQL Queries;
- Property to get Value from — defines the property based on which the filtering is performed. This property will be used as a value of the filter option;
- Property to get Label from — defines how the option will be labeled;
- Is Checkbox Meta Field (Jet Engine) — this option can be switched on to filter items by the “Checkbox” meta field saved as an array, “Select” Meta field saved as multiple select, “Posts” Meta field saved as multiple, or “Checkbox” Meta field of ACF;
- Query Variable — this field is obligatory for completing the filter settings. When filtering by a meta field, copy and paste the Name/ID of the meta field into the Query Variable field. For multiple field keys, separate them with commas. Also, it is possible to select the Taxonomy option in the list of Query Variables to filter posts by terms. Another possible use case is filtering related items; for this purpose, select one of the JetEngine options from the dropdown.
For example, a Terms Query in the WordPress Dashboard > JetEngine > Query Builder > Add New directory can be built and listed terms from a custom taxonomy in alphabetical order. The purpose is to use this generated list of terms as a filter source to filter posts by.
According to the used query, the ID of the term is the Value, and the name of the term is the Label. The Preview results can be activated to see how these properties are named. The ‘term_id’ property represents the ID of the term, and the ‘name’ property presents the name of the term.
Now, let’s return to the settings of the filter.
Firstly, it is needed to select the created custom query in the Select Query drop-down. The Property to get Value from defines the property based on which the filtering will be performed. According to the used query, the ‘term_id’ property is the value. The Property to get Label from is what a user sees on the front end as a label of an option. According to the described case, the property containing the term’s name is ‘name.’ Finally, the Taxonomy option is selected as a Query Variable because posts should be filtered by terms.
In the result, we get an ordered list of terms as filter options.
JetEngine Query Builder Switcher Source
The “JetEngine Query Builder Switcher” Data Source is available in the Select and Radio filters’ settings. Requires the JetEngine plugin of 3.2.0 version and higher to be activated.
This data source type allows switching custom queries of JetEngine from the front end.
The list of settings for the “JetEngine Query Builder” Data Source includes:
- Select Query — here, one picks multiple custom queries that should be switched by the filter on the front end. All kinds of custom queries are supported.
- Query Variable — in the dropdown list of Query Variables, one should select “Switch JetEngine query.”
This Data Source can be used to switch queries of the same type using the preferred kind of filter — Radio or Select. The name of the filter option will be represented by the name of the custom query.
As before, to display posts (or Users, Custom Content Type items, etc.) queried differently, one had to place several Listing Grid widgets/blocks/elements on the page and apply a separate custom query to each. Now, it is possible to use just one widget/block/element to display the queried items and switch the queries with a filter.
For example, some posts should be displayed on a page. When applying the filter, only the newest posts are desired to be shown, those created within the last two weeks. Older posts should not be displayed.
For this purpose, two Posts Queries should be created. The first Posts Query lists all posts and is named “All Posts”; the second Posts Query lists only posts created in the last two weeks and is named “Latest posts.”
In each custom query, a Query ID should be defined. The Query ID should be the same in both queries.
Once the queries are created, we select them in the settings of our Select filter. Also, we apply the Switch JetEngine query Query Variable.
Now, it is time to display the items on the website. It can be done with a Listing Grid widget for Elementor so that a Listing Template can be built beforehand.
The Listing Grid widget and the Select filter widget should be placed on the needed page. In the Listing Grid widget, the created Listing Template should be picked, and the “All Posts” custom query applied. In this way, the listing will display all posts initially.
Also, the Query ID from the settings of the custom queries should be copied and pasted into the CSS ID field of the “Advanced” tab of the Listing Grid widget settings.
In the Select Filter widget, the created filter should be picked, the Provider set to “JetEngine” (because the “JetEngine” provider stands for the Listing Grid), and the Query ID pasted.
Now, the filter is ready for use. When selecting the “Latest posts” option, the listing displays only the posts created in the last two weeks.
Search Filter Sources
The Search filter type provides two data sources:
- Default WordPress search — with the help of this data source, the Search filter will look at the post title, post excerpt, and post content for a match with the searched value;
- By Custom Field (from Query Variable) — this data source allows searching in meta fields. The filter will search in the values of meta fields listed in the Query Variable field. For multiple meta fields, separate them with commas.
That’s all about the filters data sources available with the JetSmartFilters plugin for your WordPress website.