Looping over images in a media folder

Hi there. I am thinking of using Grav to build an artist’s portfolio website. I am still in the early stages, just playing around, but I’m having trouble using Grav’s media functionality to loop over images in a media folder. This is what I am trying, and nothing shows up:

{% for image in page.find('/paintings').media  %}
   {{ image.resize(270, 190).html() }}
{% endfor %}

But it works just fine if I do it on a single image by name, like this:

{{ page.find('/paintings').media['01Full.jpg'].resize(270,190).html() }}

So far, the only way I have found of getting the looping code to work is to manually upload each image onto a page in the adminterface.

What is going on here? Is this a bug? Thanks for any help.


Ok, I guess I figured it out. If I do:

{% for image in page.find(’/paintings’).media.images %}

it works. Though given that individual images are accesible directly on the media object, and that this format is all over the documentation, and that there are no examples of the looping, I don’t think my confusion was unreasonable.

Also, never mind that bit about the adminterface. I was wrong about that.

Take a look at this: Gallery Tutorial