fourkitchens / emulsify

DEPRECATED (see README for new version)
GNU General Public License v2.0
162 stars 70 forks source link

Attributes question #335

Closed dchaffin closed 5 years ago

dchaffin commented 5 years ago

In @atoms/_field.twig, I see:

<div{{ attributes }}>

But I can't tell that it's doing anything. I want to add a class to that. Is this the correct way?

{% include "@atoms/_field.twig" with {
  attributes: { '#class': 'field--image' }
} %}

Thanks!

ctarres commented 5 years ago

Hello.

I don't know if it's correct but you can use this:

{% include "@atoms/_field.twig" with { attributes: create_attribute({'class': ['test', 'test--red']}) } %}

dchaffin commented 5 years ago

@ctarres - Thanks! That worked!