Hello I’m new to Grav and I really like it for its simplicity. Now I want to go little deeper. I would like make simple gallery consisting of child pages. I managed to make gallery on single page using {% for image in page.media.images %} loop.
So my goal is to make page which is build from child pages containing only title, some description and all media images from child page folder.
I’ve done this and I’m pretty sure it works too. I’m a little busy. If you can’t wait for someone else to answer, could you remind me to find it? Cheers
@kmk, You shared your intention and code, but what I’m missing is the problem you are facing…
Here is some guesswork:
If gallery is totally empty:
Did you define a collection in the page in which you want to create a gallery?
E.g:
content:
items: '@self.children'
If it shows titles of children with image(s) of current page (if any):
Your inner loop should not use ‘page’ (which references the current page), but ‘p’ which references a child page in the collection.
It should be:
{% for child in page.collection %}
...
{% for image in child.media.images %}
...
{% endfor %}
{% endfor %}
N.B. For clarity of the code I renamed the variable.
@kmk, Glad to here your original issue has been resolved.
This new questions seems unrelated and warrents for posting a new issue. Would you mind flagging your last reply for deletion (click the 3 horizontal dots and click the waste-bin) and open a new issue?