Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filtering images for collections #6

Open
variar opened this issue Apr 6, 2017 · 2 comments
Open

Filtering images for collections #6

variar opened this issue Apr 6, 2017 · 2 comments
Assignees

Comments

@variar
Copy link
Owner

variar commented Apr 6, 2017

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
Copy link
Owner Author

variar commented Apr 6, 2017

@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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants