Is there a way to get content from a sub folder NOT using the modular functionality? So, for example:
This grabs and loops all images within the folder:
{% for image in page.media.images %}
{{ image.html }}
{% endfor %}
But I want to grab all images within the current pages sub folder called ‘gallery’ - e.g:
{% for image in page/gallery/.media.images %}
{{ image.html }}
{% endfor %}
But also do this for content as well, so if a page had a sub folder called ‘about’ then something along the lines of:
{% get from page/about %}
{{ content }}
{% endfor %}
Is page.find scope-limited to start at the top level? I don’t have access to my local dev env, but I imagine you could combine find with page.children to access a specific folder below the current page. Something like:
{% set gallery = page.children.find('/gallery') %}
{% for image in gallery %}
{{ image.html }}
{% endfor %}
cool, glad it worked out. FYI per the link in my post above, its not page.children.find but rather page.find(’/blog’).children. Which would return an array of page objects for all the pages that are children of the ‘/blog’ page.
so combining with your code above you could use it like so (not tested, just my interpretation):
{% for blogpost in page.find('/blog').children %}
{{ blogpost.content }}
{% for image in blogpost.media.images %}
{{ image.cropZoom(600, 400).html() }}
{% endfor %}
{% endfor %}