0

I am using Grav Cms w/materilaize.css. For image capition I need the following html syntax in materialize:

<img class="materialboxed" 
     data-caption="A picture of a way with a group of trees in a park" 
     src="https://lorempixel.com/800/400/nature/4"
>

In twig I use the following in general:

{{ image.html('', '', 'materialboxed responsive-img card') }}

But I do not know how can I add the data-caption element to this line?

Ali Khaki
  • 1,184
  • 1
  • 13
  • 24
karzol73
  • 55
  • 1
  • 11

1 Answers1

0

The best route would be to use the url function instead of html, as it provides more flexibility in modifying the actual element.

<img src="{{ image.src }}" 
  class="materialboxed responsive-img card" 
  data-caption="A picture of a way with a group of trees in a park"
>
Grant
  • 1,822
  • 1
  • 21
  • 30