{% apply spaceless %} {% for menu in items %} {%- set translation_domain = menu.extra('translation_domain', 'messages') -%} {# We use method accessor instead of ".label" since `menu` implements `ArrayAccess` and could have a property called "label". #} {%- set label = menu.getLabel() -%} {%- if translation_domain is not same as(false) -%} {%- set label = label|trans(menu.extra('translation_params', {}), translation_domain) -%} {%- endif -%} {% if not loop.last %}
  • {% if menu.uri is not empty %} {% if menu.extra('safe_label', true) %} {{- label|raw -}} {% else %} {{- label|u.truncate(100, '...') -}} {% endif %} {% else %} {{ label|u.truncate(100, '...') }} {% endif %}
  • {% else %}
  • {{ label|u.truncate(100, '...') }}
  • {% endif %} {% endfor %} {% endapply %}