So I have a code that's like this:
<a {% if options.style %} style="{{ options.style }}" {% endif %} href="{{ path }}">some text</a>
Now I want to add an additional property tp style, say for padding
that's coming from another attribute. How can I do that?
I tried this way but it didn't work.
<a {% if options.style %} style=" {{ {...options.style, padding: {{data.linkPadding}}} }}" {% endif %}>some Text</a>
Since this is nunjucks (it doesn't work like just extending javascript object as I was trying to do), the way to do this would be following:
<a
{% if options.style %}
style="{{ options.style }};
padding: {{data.linkPadding}}"
{% endif %}>some Text</a>
This was answered by Bob on apostrophe Discord community.