Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

Including images without their name

Started by Muut Archive 10 years ago · 2 replies · 441 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 2290 9 years ago
Archive · by Muut Archive, 9 years ago
2 1506 9 years ago
Archive · by Muut Archive, 9 years ago
2 4757 9 years ago
Archive · by Muut Archive, 9 years ago
1 3572 9 years ago
Archive · by Muut Archive, 9 years ago
3 1630 9 years ago