<a href="{{url}}">{{name}}</a>

{{#if children}}
  <i class="icon-plus nav-icon" data-flyout-toggle></i>

  <ul class="navigation-tier nav-submenu" data-flyout-tier>
    {{#if pages}}
      {{#if show_all}}
        {{#if url '!==' '#'}}
          <li class="nav-submenu-item">
            <a href="{{url}}">{{name}}</a>
          </li>
        {{/if}}
      {{/if}}
    {{else}}
      {{#if show_all}}
        <li class="nav-submenu-item">
          <a href="{{url}}">{{lang 'header.categories_all_item'}} {{name}}</a>
        </li>
      {{/if}}
    {{/if}}
    {{#each children}}
      <li class="nav-submenu-item {{#if children}}has-dropdown{{/if}}">
        <a {{#if children}}href="#" class="nav-submenu-toggle" data-flyout-toggle{{else}}href="{{url}}"{{/if}}>{{name}}</a>

        {{#if children}}
          <i class="icon-plus nav-icon" data-flyout-toggle></i>

          <ul class="navigation-tier nav-submenu" data-flyout-tier>
            {{#if show_all}}
              <li class="nav-submenu-item">
                <a href="{{url}}">{{lang 'header.categories_all_item'}} {{name}}</a>
              </li>
            {{/if}}
            {{#each children}}
              <li class="nav-submenu-item">
                <a href="{{url}}">{{name}}</a>
              </li>
            {{/each}}
          </ul>
        {{/if}}
      </li>
    {{/each}}
  </ul>
{{/if}}
