I’m trying to dynamically set the FA icon in a looper using the result of some Twig statements. If I put the {{looper.item}} in the Icon element’s regular text field, it’s fine and shows the correct string (ie ‘instagram’) but if I use it in the icon field with breakout mode it doesn’t set the icon as I was hoping. It works as expected if I set it up as an element parameter so there must be something about the Twig output and the icon field that I don’t quite understand.
Twig code:
{% set social = {‘facebook’:‘facebook-f’,‘instagram’:’’} %}
{% for key,value in social %}
{% if key in looper.item %}
{% set icon = value?:key %}
{{ icon }}{% endif %}{% endfor %}