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

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

Started by William Saxton 9 years ago · 4 replies · 832 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 Sebadamus, 2 days ago
2 65 21 hours ago
Themes & Styling · by martynfoster735, 4 days ago
1 158 3 days ago
Themes & Styling · by Justin Young, 2 weeks ago
1 218 2 weeks ago
Themes & Styling · by Slebeig, 1 month ago
4 349 1 month ago
Themes & Styling · by Pedro M, 3 months ago
4 704 3 months ago