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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Themes & Styling

Page.media.images vs page.media

Started by Dan 6 years ago · 1 replies · 868 views
6 years ago

I'm working on a blog that allows the author to include a series of images in their post. Some of posts include animated gifs. I understand that gifs are excluded from page.media.images because the image filters do not work on them.

I can loop through page.media and it includes the gifs, but the images are not the same order as media_order. The image order is important. I supposed I could loop through the media_order array, and create the image tags myself, but I was hoping there is a more elegant way. My end goal is display all the .jpg .png and .gif images in the order specified by the author.

6 years ago

The media_order suggests ordering of page.media and apparently it's working on a level deeper namely page.media.images. This sounds like a possible improvement. I suggest you post an issue in the core Grav repository.

👍 1

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by Pedro M, 2 months ago
4 226 2 months ago
Themes & Styling · by Ian, 2 months ago
3 118 2 months ago
Themes & Styling · by Norbert, 2 years ago
11 483 3 months ago
Themes & Styling · by Lukáš Findeis, 3 months ago
0 73 3 months ago
Themes & Styling · by Sebadamus, 4 months ago
5 152 3 months ago