I want to have an html element with two classes defined by twig variables. I can do it with one twig variable and they both work separately. But once I try to have them together, only the first class is effective. I searched on the forum but found only about twig classes or two classes direct in html. With Twig I have:
<p class={{"type#{item.type1}"}}> Paragraph </p>
In html it should be:
<p class="type1 type2"}}
When I try to combine both as below, it does not work:
<p class={{"type#{item.type1} type#{item.type2}"}} > Paragraph </p>
I also have tried the other concat method with ~
but without sucess.
How to concatenate strings in twig
And instead of the space I have tried to add
as explained here also unsucessful:
How to add space between variables in twig template?