grav-plugin-unitegallery icon indicating copy to clipboard operation
grav-plugin-unitegallery copied to clipboard

Filtering images for collections

Open variar opened this issue 7 years ago • 2 comments

Copied @MrMacStripe suggestion from #5.

I´ve got another idea that would enhance the usability further.

Implementing a "display only images that contain this string" option. Since Grav provides the meta option, you should be able to crawl the images within a page for class-names, alt-names, titles and the actual filename. That would enable to simplifiy the use-case for things like:

I´ve got images from 2016, 2015 and 2014. The file names are 2014_1,2014_2,2015_1 and ongoing. Now display a gallery sorted by years.

The implementation would be pretty simple. PHP offers an actual function for this if I remember correctly.

variar avatar Apr 06 '17 15:04 variar

@MrMacStripe could you give an example of possible usage syntax for this?

One solution might be to implement custom twig filter function that will select several images from page.media.images array. But I'm not sure if this will be easy enough to use.

variar avatar Apr 06 '17 20:04 variar

I think with a lot of images there will be huge disk load. i thing there must be some caching or indexing for that.

pbt39ppc avatar Dec 23 '20 22:12 pbt39ppc