{% macro checkIsActive(path, link) %}{{ ( not path and not link ) or (path and link and path starts with link)? " active idsk-in-page-navigation__list-item--active " }}{% endmacro %}
{% for item in items %}
{% set active = _self.checkIsActive(app.request.requesturi | trim('/'), item.publicLink | trim('/')) %}
{% if item.children is defined and item.children | length %}
<li id="menu_item_{{ item.id }}" class="{{ active }} {{ item.lvl > 1 ? " dropdown-submenu" : " nav-item dropdown"}} idsk-in-page-navigation__list-item">
<a class="dropdown-toggle {{ active }} {{item.lvl > 1 ? " dropdown-item" : "nav-link"}} idsk-in-page-navigation__link" {{ item.lvl > 1 ?: 'data-bs-toggle="dropdown"'}}
href="{{ 'page' == item.linkType
? path('default_subpage',{'seoid':item.publicLink})
: item.publicLink }}"
>{{ item.name }}</a>
<ul class="dropdown-menu dropdown-menu-end idsk-in-page-navigation__list">
{{ include('@ScoreCms/Public/default/_menuTree.html.twig',{'items': item.children}) }}
</ul>
</li>
{% else %}
<li id="menu_item_{{ item.id }}" class="{{ active }} {{ item.lvl > 1 ?"": "nav-item"}} idsk-in-page-navigation__list-item">
<a class="{{ active }} {{item.lvl > 1 ? " dropdown-item" : "nav-link"}} idsk-in-page-navigation__link"
href="{{ 'page' == item.linkType
? path('default_subpage',{'seoid':item.publicLink})
: item.publicLink }}"
>{{ item.name }}</a>
</li>
{% endif %}
{% endfor %}