templates/includes/main-nav-sidebar.html.twig line 1

Open in your IDE?
  1. {% set navStartNode = document.getProperty("mainNavStartNode") %}
  2. {% set mainNavigation = pimcore_build_nav({active: document, root: navStartNode}) %}
  3. {% set menuRenderer = pimcore_nav_renderer('menu') %}
  4. <ul class="uk-nav">
  5.     {% for page in mainNavigation %}
  6.         {% if page.isVisible() and menuRenderer.accept(page) %}
  7.             {% set hasChildren = 0 %}
  8.             {% if page.hasPages() %}
  9.                 {% for child in page.getPages() %}
  10.                     {% if page.isVisible() and menuRenderer.accept(child) %}
  11.                         {% set hasChildren = hasChildren + 1 %}
  12.                     {% endif %}
  13.                 {% endfor %}
  14.             {% endif %}
  15.             {% if hasChildren == 0 %}
  16.                 {% if not page.getClass('apk-highlight-link') %}
  17.                 
  18.                     <li class="{% if page.getActive(true) %}uk-active{% endif %} apk-highlight-link-container">
  19.                         <a href="{{ page.getHref() }}" class="{{ page.getClass() }}" {% if page.getTarget() != NULL %} {{ page.getTarget() }} {% endif %}>
  20.                             {{ page.getLabel()|trans }}
  21.                         </a>
  22.                     </li>
  23.                 {% else %}
  24.                     <li class="{% if page.getActive(true) %}uk-active{% endif %}">
  25.                         <a href="{{ page.getHref() }}" class="{{ page.getClass() }}" {% if page.getTarget() != NULL %} {{ page.getTarget() }} {% endif %}>
  26.                             {{ page.getLabel()|trans }}
  27.                         </a>
  28.                     </li>
  29.                 {% endif %}
  30.             {% else %}
  31.                 {% if not page.getClass('apk-highlight-link') %}
  32.                     <li class="uk-parent apk-highlight-link-type {% if page.getActive(true) %}uk-active{% endif %}">
  33.                 {% else %}
  34.                     <li class="uk-parent {% if page.getActive(true) %}uk-active{% endif %}">
  35.                 {% endif %}
  36.                     {% if page.getClass('apk-highlight-link') %}
  37.                         <a href="{{ page.getHref() }}" class="{{ page.getClass() }} apk-highlight-link-container" {% if page.getTarget() != NULL %} {{ page.getTarget() }} {% endif %}>
  38.                             {{ page.getLabel()|trans }}
  39.                         </a>
  40.                     {% else %}
  41.                         <a href="{{ page.getHref() }}" class="{{ page.getClass() }}" {% if page.getTarget() != NULL %} {{ page.getTarget() }} {% endif %}>
  42.                             {{ page.getLabel()|trans }}
  43.                         </a>
  44.                     {% endif %}
  45.                         {% set navBreakPoint = pimcore_website_config('main-nav-breakpoint') %}
  46.                         {% if navBreakPoint is not empty  %}
  47.                             {% set countPage = page.getPages()|length %}
  48.                             {% if countPage > breakpointChild %}
  49.                                 {% set countChild = (countPage / 2)|round %}
  50.                             {% else %}
  51.                                 {% set countChild = null %}
  52.                             {% endif %}
  53.                         {% else %}
  54.                             {% set countChild = null %}
  55.                         {% endif %}
  56.                         <ul class="uk-nav-sub">
  57.                             {% set i = 1 %}
  58.                             {% for child in page.getPages() %}
  59.                                 {% if child.isVisible() and menuRenderer.accept(child) %}
  60.                                     <li class="{% if child.getActive(true) %}uk-active{% endif %}">
  61.                                         <a href="{{ child.getHref() }}" class="{{ child.getClass() }}" {% if child.getTarget() != NULL %} {{ child.getTarget() }} {% endif %}>
  62.                                             {{ child.getLabel()|trans }}
  63.                                         </a>
  64.                                     </li>
  65.                                 {% endif %}
  66.                                 {% set i = i + 1 %}
  67.                             {% endfor %}
  68.                         </ul>
  69.                     </li>
  70.             {% endif %}
  71.         {% endif %}
  72.     {% endfor %}
  73. </ul>