{% spaceless %} {# Parameters: - "description" (string) (default: ''), - "variant" (string) (default: ''): can be 'vertical', - "links" (array) (default: []): format: [ { "path" (string) (default: ''), "label" (string) (default: ''), "icon_position" (string) (default: ''), "variant" (string) (default: ''), "icon" (array) : format: [ { "name" (string), "size": (string), "path": (string), "extra_classes": (string) }, ... ] }, ... ] - "extra_classes" (string) (default: '') - "extra_attributes" (array) (default: []): format: [ { "name" (string) (default: ''), "value" (optional) (string) ... ], #} {# Internal properties #} {% set _css_class = 'ecl-social-media-follow' %} {% set _extra_attributes = '' %} {% set _description = description|default('') %} {% set _links = links|default({}) %} {% set _variant = variant|default('') %} {# Internal logic - Process properties #} {% if _variant is defined and _variant is not empty %} {% set _css_class = _css_class ~ ' ecl-social-media-follow--' ~ _variant %} {% endif %} {% if extra_classes is defined and extra_classes is not empty %} {% set _css_class = _css_class ~ ' ' ~ extra_classes %} {% endif %} {% if extra_attributes is defined and extra_attributes is not empty and extra_attributes is iterable %} {% for attr in extra_attributes %} {% if attr.value is defined %} {% set _extra_attributes = _extra_attributes ~ ' ' ~ attr.name|e('html_attr') ~ '="' ~ attr.value|e('html_attr') ~ '"' %} {% else %} {% set _extra_attributes = _extra_attributes ~ ' ' ~ attr.name|e('html_attr') %} {% endif %} {% endfor %} {% endif %} {# Print the result #}