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

Including images without their name

Started by Muut Archive 10 years ago · 2 replies · 346 views
10 years ago

I have many images:

TXT
pages/works/work1/image1.png
pages/works/work1/image2.png
pages/works/work1/image3.png
pages/works/work1/image4.png

and some MarkDown-files:

TXT
pages/works/works.md
pages/works/work1/work.md

I'd like to include those images without using their names.

Thank you very much !!!

10 years ago

Sure, you just need to loop over page.media.image when displaying the page:

TWIG
{% for image in page.media.images %}
   {{ image.html }}
{% endfor %}

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1362 9 years ago
Archive · by Muut Archive, 9 years ago
2 939 9 years ago
Archive · by Muut Archive, 9 years ago
2 4069 9 years ago
Archive · by Muut Archive, 9 years ago
1 2959 9 years ago
Archive · by Muut Archive, 9 years ago
3 1124 9 years ago