{% for item in menu_items %}
{% if item.parent is null
and item.isActive
and (item.publishUntil is null or item.publishUntil >= "now"|date)
and (
item.visibility == 'all' or
(item.visibility == 'connected' and is_granted('ROLE_USER')) or
(item.visibility == 'guest' and not is_granted('ROLE_USER')) or
(item.visibility == 'admin' and is_granted('ROLE_ADMIN'))
)
%}
{% set isExternal = item.url is not empty and item.url starts with 'http' %}
{% set href = item.url is not empty ? item.url : (item.route is not empty ? '/' ~ item.route : '#') %}
{% for child in children %}
{% set childHref = child.url is not empty ? child.url : (child.route is not empty ? '/' ~ child.route : '#') %}
{% set isChildExternal = child.url is not empty and child.url starts with 'http' %}
{{ icon(child.icon ?: 'circle') }}
{{ child.title }}
{% endfor %}
{% endif %}
{% endif %}
{% endfor %}
{% if is_granted('ROLE_USER') %}
{% else %}
{% endif %}