0

In the Kuma CMS, our users create list items for instructions. There are titles and other text as well. Mostly h2, ul/li, and p elements.

It gets added to the page with {{ resource.list|raw }}

Is there a way to add a class to only LI tags within the {{ resource.list|raw }}?

John Conde
  • 217,595
  • 99
  • 455
  • 496
joezilla
  • 3
  • 2

1 Answers1

1

You could try to replace the <li> tags:

{{ resource.list|replace({'<li>': '<li class="your-class">'})|raw }}

Working example: https://twigfiddle.com/svajsh

tino.codes
  • 1,512
  • 1
  • 12
  • 23