Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

Grav timing out of while looping over a collection of images

Started by Clay 6 years ago · 0 replies · 477 views
6 years ago

I have built a page with a sub-page that isn't routable, but just used for image storage.

On the parent page, I use the following to get the collection of images from the child:

TWIG
{% for p in page.collection %}
{% for image in p.media.images %}
   ...do stuff with the image urls...

However, I am finding that grav is timing out trying to deal with the number of images in the child because it wants to create thumbnails, etc. Refreshing the page several times will eventually get through the problem and display the page quickly. However, obviously, this is not an ideal solution.

There are only about 100 images in the child at the moment. I could see several hundred or a thousand being in there (trying to build a catalog like system).

How can I stop grav from doing all this thumbnail/image-processing busy-work when all I really want is to grab the urls and meta-data of these files? Or how can I programmatically tell grav "Ok, process THAT image NOW" rather than have it decide it needs thumbnails for everything all at once?

Thanks!

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 4 days ago
2 101 16 hours ago
General · by pamtbaau, 22 hours ago
1 68 21 hours ago
General · by Andy Miller, 1 day ago
0 53 1 day ago
General · by Marcel, 12 months ago
6 361 5 days ago
General · by Duc , 6 days ago
3 49 6 days ago