I have this in my YAML:
page_heading: 'School Profile'
paragraphs:
-
text: "## Lorem ipsum dolor sit amet, consectetur adipiscing elit. \r
**Nam non lectus id eros ornare mollis.** Integer sagittis dolor ut nulla sodales, vitae blandit tellus tincidunt."
image:
user/pages/02.our-school/Building.jpg:
name: Building.jpg
type: image/jpeg
size: 470189
path: user/pages/02.our-school/Building.jpg
user/pages/02.our-school/Buddies_kite_flying_2012_1.jpg:
name: Buddies_kite_flying_2012_1.jpg
type: image/jpeg
size: 435146
path: user/pages/02.our-school/Buddies_kite_flying_2012_1.jpg
I cannot work out how to get the images out of this - they are 2 arrays deep - ‘paragraphs’ is an array and ‘image’ is an array. I’ve currently got this and it gets the text field fine, but I don’t know how to loop the images inside the 1st array:
{% for item in page.header.paragraphs %}
{{ item.text|markdown }}
<hr>
{% for item in page.header.paragraphs.image %}
<img class="img-responsive" src="{{ page.media[item.name].cropZoom(600,400).quality(100).url() }}">
{% endfor %}
{% endfor %}
I’ve tried everything I can but still can’t get it to work, including:
{% for image in page.header.paragraphs.image %}
<img class="img-responsive" src="{{ page.media[image.name].cropZoom(600,400).quality(100).url() }}">
{% endfor %}
etc…