{% set onePageNavigation = pageDocument.getProperty('onePageNavigation') %}
<div class="l-navigation l-navigation__design--{{navType}} js-l-navigation {% if onePageNavigation %}js-l-one-page-navigation{% endif %}">
{# {% if not onePageNavigation %}
{% if navType == 'dynamic' %}
{% include 'html/02_body/01_header/02_navigation/navigation-shortlinks/shortlinks.html.twig' with {'shortlinks': shortlinks} %}
{% endif %}
{% endif %} #}
<div class="l-navigation__open-wrapper">
<div class="l-navigation__open js-l-navigation__open"></div>
</div>
{# Sidebar Links #}
<ul class="l-header__sidebar-links">
{% for i in sidebarLinks.iterator %}
{% set sidebarLinksImage = pimcore_image('sidebarImage',{'width': 100, 'height': 100}) %}
{% set link = pimcore_link('link') %}
{% if link.getHref() != '' and sidebarLinksImage != null %}
<li>
<a href="{{ link.getHref() }}" target="{{ link.getTarget() }}" {% if link.getClass() is defined and link.getClass() is not null %}class="{{ link.getClass() }}"{% endif %}
>
{{ convert_svg_to_code(app.request.getSchemeAndHttpHost(), sidebarLinksImage.getImage()) | raw }}
{{ link.text | raw }}
</a>
</li>
{% endif %}
{% endfor %}
</ul>
{# Panel #}
{% set navPanel = document.getProperty('navPanel') %}
{% if navPanel != null %}
{{ pimcore_inc(navPanel.getId(), {'pageId': document.getId()}) }}
{% endif %}
{% if not onePageNavigation %}
{# Set default document with id = 1 (root document) if current document is not defined #}
{# {% if not document is defined or not document %}
{% set document = pimcore_document(1) %}
{% endif %} #}
{# Get property that defines root of navigation #}
{# {% set navigationStartDocument = document.getProperty('navStartDocument') %}
{% set navigation = pimcore_build_nav({
active: document,
root: navigationStartDocument
}) %} #}
{# {% set navigationLevel1 = navigation.pages %} #}
{# {% set navigationLevel2 = [] %} #}
{# {% set navigationLevel3 = [] %} #}
{# Create navigation level 2 #}
{# {% for nagivationLevel2Page in navigationLevel1 %} #}
{# {% set pageDocument = pimcore_document(nagivationLevel2Page.getId())%} #}
{# If pimcore checkbox "Exclude from Navigation" is selected, the page and its children wont be loaded #}
{# {% if pageDocument.getProperty('navigation_exclude') == false %}
{% set navigationLevel2Pages = {'parentId': pageDocument.getId()} %}
{% set navigationLevel2Pages = navigationLevel2Pages|merge({'pages': pageDocument.children}) %}
{% set navigationLevel2 = navigationLevel2|merge([navigationLevel2Pages]) %} #}
{# Create navigation level 3 #}
{# {% for navigationLevel3Page in nagivationLevel2Page.pages %}
{% set pageDocument = pimcore_document(navigationLevel3Page.getId())%} #}
{# If pimcore checkbox "Exclude from Navigation" is selected, the page and its children wont be loaded #}
{# {% if pageDocument.getProperty('navigation_exclude') == false %}
{% set navigationLevel3Pages = {'parentId': pageDocument.getId()} %}
{% set navigationLevel3Pages = navigationLevel3Pages|merge({'pages': pageDocument.children}) %}
{% set navigationLevel3 = navigationLevel3|merge([navigationLevel3Pages]) %}
{% endif %}
{% endfor %} #}
{# End create navigation level 3 #}
{# {% endif %} #}
{# {% endfor %} #}
{# End create navigation level 2 #}
{# {% if navigationLevel1|length > 0 %}
{% include 'html/02_body/01_header/02_navigation/navigation-level-1/navigation-level-1.html.twig' with {'navigationLevel1': navigationLevel1, 'navType': navType, 'onePageNavigation': onePageNavigation} %}
{% endif %} #}
{# Render navigation level 2 if nav 1 has children #}
{# {% if navigationLevel2|length > 0 %}
{% include 'html/02_body/01_header/02_navigation/navigation-level-2/navigation-level-2.html.twig' with {'navigationLevel2': navigationLevel2} %}
{% endif %} #}
{# Render navigation level 3 if nav 2 has children #}
{# {% if navigationLevel3|length > 0 %}
{% include 'html/02_body/01_header/02_navigation/navigation-level-3/navigation-level-3.html.twig' with {'navigationLevel3': navigationLevel3} %}
{% endif %} #}
{# {% else %}
{% include 'html/02_body/01_header/02_navigation/navigation-level-1/navigation-level-1.html.twig' with {'onePageNavigation': onePageNavigation} %} #}
{% endif %}
{# Navigation backdrop for opened menu #}
{# <div class="l-navigation__backdrop js-l-navigation__backdrop"></div> #}
</div>