Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

How can I modify the html outputted from the html filter?

Started by William Saxton 9 years ago · 4 replies · 1129 views
9 years ago

Creating a slider using the following code:

TWIG
<ul>
{% for slide in page.header.slides %}
<li>{{ page.media.images[slide.image].html('', slide.description) }}</li>
{% endfor %}
</ul>

I'd like to add a style to the img tags. Is there documentation on how to do this?

9 years ago

Just target it with CSS: ul li img, optionally adding a class to the unordered list like <ul class="mylist"> and target it with .mylist li img.

9 years ago

You can't modify the .html output, but you can create your own HTML tag and simply use the .url method for the URL part.

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by themetman, 6 days ago
1 103 3 days ago
Themes & Styling · by AH, 3 weeks ago
1 223 3 days ago
Themes & Styling · by Bruno, 4 years ago
6 1386 3 days ago
Themes & Styling · by TomW, 3 weeks ago
2 227 5 days ago
Themes & Styling · by FrViPofm, 2 months ago
4 687 2 months ago