variar / grav-plugin-unitegallery

Grav plugin to create image galleries with unitegallery js library
MIT License
19 stars 5 forks source link

Filtering images for collections #6

Open variar opened 7 years ago

variar commented 7 years ago

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 commented 7 years ago

@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.

pbt39ppc commented 3 years ago

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