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

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

Started by William Saxton 9 years ago · 4 replies · 907 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 stuart young, 1 month ago
3 441 1 month ago
Themes & Styling · by Sebadamus, 1 month ago
5 457 1 month ago
Themes & Styling · by martynfoster735, 2 months ago
1 442 2 months ago
Themes & Styling · by Justin Young, 2 months ago
1 467 2 months ago
Themes & Styling · by Slebeig, 3 months ago
4 594 3 months ago