Compatible Omni Gallery Image Selectors can be filtered dynamically by extending path segments and by query string parameters. This enables the images shown to be filtered by:
Currently compatible Image selectors are:
Other image selectors can potentially be extended to support external filtering and further attributes incorporated into the filter options. Please contact me if you have further image filtering and searching requirements.
Filters are applied to the base list used to provide images, which is not necessarily the actual images.
For Fileset Dynamic and Folder Dynamic image selectors, this means filters work directly on image attributes.
For the Page List Dynamic image selector, the filters work on page attributes (not on the subsequent image attributes)
For the Express List Dynamic image selector, the filters work on the express object attributes (not on the subsequent image attributes)
External filters respond to path segments as provided by filtering blocks for Page Lists:
Date Navigation and Tags blocks can be used easily with Page List Dynamic because they auto-populate options from the corresponding site pages and attributes.
Files already have Tags. To use Topics you will need to add a Topics attribute to files. To use Tags or Date filtering for lists of files, you will need to either create a Date Navigation or Tags block template populated from files or to assemble a list of filtering links by hand.
Lists of Express objects have similar considerations, with the additional provision that to filter by Tags you will need to add a Tags attribute to the express objects.
The fundamental mechanisms of the blocks discussed above is to append path segments to the URL.
Date filtering appends the URL with a 4 digit year and 2 digit month, so the page path now ends /yyyy/mm/. For example
Date filtering can also be specified by query string parameters using the keys y, year, m, month. With this format, you can filter by a year without specifying a month, but you cannot filter by a month without specifying a year. For example
Tags filtering similarly appends the path with /tag/tagword/. For example
Tags filtering can also be specified by query string parameters using the key tag. For example:
Topics filtering appends the path with /topic/topic_id/topic_handle/. The segments /topic/ and /topic_id/ are used, while the final /topic_handle/ segment is only there for making the URL look pretty. With that in mind, and taking topic IDs from a standard Atomik sample content, our examples are:
If you prefer to use URL query parameters, the equivalents are:
The magic for keyword filtering uses any of q, query, search, keywords. For path parameters, our examples are now:
Similar searches by URL get parameters are:
Filtering works on the fields the core lists query using the method filterByKeywords().
As already mentioned above, the core Date Filter, Topics and Tags blocks are populated from page attributes and properties. These may not align with file or express attributes and properties.
Omni Gallery pagination also uses path segments. It is not advisable to use filtering in association with paginated galleries.
Filtering works within image selectors, so as long as you configure a compatible image selector you can use any Display Widget to show the filtered gallery. Just don't configure it to paginate.
Date filtering is mapped to the corresponding creation dates for pages, files or express objects. Other filters work with Topics and Tags attributes or properties.
If such attributes are not configured, the filter will be ignored and an error noted in the site Log at /dashboard/reports/logs/.
Filtering by keywords, such as from a search query, uses the core filterByKeywords() method for the respective list class. This knows nothing about Omni Gallery name and description attribute mapping.
When an Image Selector builds a list of images, external filters are applied last. Where an Image Selector already provides options to filter the list of images, perhaps by attribute or by date, the external filters are applied after the filters configured in the block edit dialogue.
An external filter may compound a configured filter, or it may override it. Behaviour is entirely dependent on how the respective core list class handles multiple filters. Similarly where more than one external filter is applied the filters may compound or override in the order they are specified in the path segments or query string.