Community

Collections and filtering by a column

I have a situation where a website has a Collection which contains content which has been tagged using Tagger. These are articles which have been tagged with two different groups (e.g. a month and a year).

As the content list grows it would be amazing to be able to filter this Collection based on the tags. Using the search field won’t work because we’d like to be able to reduce the table based on the combination of a month and year.

I did think of using MIGX whose table could be filtered, but this site will be using Content Blocks which I don’t think will play nicely with MIGX because it won’t be able to filter availability of block types based on templates etc (features I’m using).

Does anyone have a solution for filtering the Collections grid in this manner?

It’s an interesting question.

An ‘I’ve never done anything like this myself’ disclaimer applies but you could possibly inject the filter controls (month, year) into the grid tbar along with a modified baseURL pointing at an extended processor that takes account of the tags in the existing collections CMP or replace the existing one with an extended version via a plugin but you’d have to be very mindful of the potential for collection upgrades breaking your extended classes, both JS and PHP.

As I understand, each resource in a collection extends modresource, I’m not clear why you couldn’t use MIGX to list the collection resources, limiting the list with the class key, with full access to the template field too but you might have to recreate other functionality of the collection grid to meet your needs so I think extending it instead seems like a more efficient way to go. With MIGX you’d also have to take care of the processor functions so I can’t see any gain there.