{% spaceless %} {# Parameters: - "title" (string) (default: '') - "links" (array) (default: predefined structure): format: [ { href: (string) (default: ''), label: (string) (default: '') }, ... ] - "icon_path" (string) (default: ''): path to the icons svg - "extra_classes" (string) (default: '') - "extra_attributes" (array) (default: []): format: [ { "name" (string) (default: ''), "value" (optional) (string) ... ] #} {# Internal properties #} {% set _css_class = 'ecl-inpage-navigation' %} {% set _icon_path = icon_path|default('') %} {% set _extra_attributes = 'data-ecl-auto-init="InpageNavigation"' %} {# Internal logic - Process properties #} {% 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 #} {% endspaceless %}