{% macro menuTree(menu, level_max, level = 0) %}
   <ul>
      {# @var \KupShop\ContentBundle\Entity\Wrapper\PageWrapper[] menu #}
      {% for item in menu %}
         {% if item.figure == 'Y' %}
            <li class="item-{{ item.id }}">
               <a href="{{ item.correct_url }}" {% if item.target %}target="{{ item.target }}"{% endif %}
                  rel="noreferrer" title="{{ item.name }}">{{ item.name_short }}</a>
               {% if (level < level_max or level_max < 0) and item.children %}
                  {{ _self.menuTree(item.children, level_max, level + 1) }}
               {% endif %}
            </li>
         {% endif %}
      {% endfor %}
   </ul>
{% endmacro %}

<div {{ attributes }}>
   {% if this.menu %}
      <p class="title-default">{{ this.menu.name_short }}</p>
      {{ _self.menuTree(this.menu.children, this.level_max) }}
   {% endif %}
</div>
