Content pages by almost any criteria and advanced sorting

Preset Filters

The Joomla core has limitations regarding the criteria we can use to display a collection of articles on the front end. We can create an article collection based on a category and/or tags. But what if we want to use custom fields or native fields, like the creation date or the author, as criteria?

Let’s say we have a Job listings website, where we use custom fields to declare properties like the location of the job and the required skills. How can we display a list of jobs on a specific location?

JFilters allows you to create pages by almost any possible property. Additionally, it allows you to order/sort the articles by various criteria.
To create a collection of articles based on filters, just create a menu item of type JFilters > Results and use the Preset Filters setting (under the Options tab). This setting allows us to predefine filters for that page.

A few tips on how to use it.

1. For selectable values (I.e. text), just select the values you want, under each filter.

2. For numerical or date filters, which are set to be used as ranges , we can select a range.
The way to do that, is by selecting 2 values (the 1st lower than the 2nd)
preset range

*In that example, all articles having rating between 6 and 8 will be displayed.


You can select values from all the available filters, though if you intent to further filter the items of that page using the JFilters filters module, keep in mind that the preset filters always persist in that page and cannot be cleared. That means that the selected filter values will always be shown as selected, even if you try to clear them. So, if you intent to show the JFilters filters module in those pages, make sure that the filters used as preset filters are not displayed in the filtering module. This can happen by either using filters in Listening state   or by selecting specific filters to be loaded in the module. A usual case though, is to select categories in Listening state as preset filters.

Regarding SEO, this page is a proper Joomla page, that can have its own title and metadata. Though, again if you intent to use the filtering module, the selection of filters can alter the page’s title. There are 3 options here:

1) Use the menu item’s title no matter the selected filters from the module. To do that, you have to disable the “Show Selections in Page Title” setting in each of your filters or globally from the JFilters component configuration.

2) Append the selected filter values to the existing menu item’s title (“Apartments “ + “Loft”). To do that, enable the setting “Append New Title in Menu Item's Title” in the JFilters component configuration.

3) Let the selected filters replace your menu item’s title. This will happen if the "Show Selections in Page Title” setting is enabled and the “Append New Title in Menu Item's Title” is disabled.

Now, you cannot only display a collection of articles by various criteria, you can also sort/order your articles by specific criteria. This can be done by using the Sorting Rules feature, found in the JFilters > Results menu item as well. You can set any of your filters as a sorting criteria or let your users select the sorting criteria they prefer.

sorting rules

According to our users, these features are a real game changer for Joomla, adding capabilities that have been highly requested in a CMS.
We hope you enjoy them!

Follow us and get notified of our latest blog posts

Our favorite topics are about the Joomla's Custom Fields, Joomla Search and Filtering