{* if you need more or less deeper tree data in $_categories set the maxlevel paramter in xtCore/boxes; default maxLevel is 3 *}
{block name=boxes_boxCategoriesRecursive}
    {if $_categories}

        {if $params.position == 'navbar'}

            {block name=boxes_boxCategoriesRecursive_positionNavbar_include_mobileNavigation}
                {if $params.template eq 'overlay'}
                    {include file="includes/partials/navigation/mobile_navigation.html" type="tpl_include"}
                {/if}
            {/block}

            {block name=boxes_boxCategoriesRecursive_positionNavbar_include_megaMenu}
                {if $params.template eq 'mega_menu'}
                    {include file="includes/partials/navigation/mega_menu.html" type="tpl_include"}
                {/if}
            {/block}

        {else}

            <div class="{$params.name} {$params.position} cid-{$current_parent_id} box-categories panel panel-default text-word-wrap">
                <div class="panel-heading">
                    <p class="panel-title text-uppercase">
                        <i class="fa fa-bars"></i>
                        {if $current_parent_data}
                            <a href="{$current_parent_data.categories_link}">{$current_parent_data.categories_name}</a>
                        {else}
                            {txt key=TEXT_BOX_TITLE_CATEGORIES}
                        {/if}
                    </p>
                </div>
                <ul class="nav nav-pills nav-stacked">
                    {foreach name=aussen item=module_data from=$_categories}
                        <li class="level-{if $current_parent_id}{$module_data.level-1}{else}{$module_data.level}{/if} cid-{$module_data.categories_id}{if $module_data.active} active{/if}">
                            <a href="{$module_data.categories_link}"><span class="{if $module_data.level > 3}icon{/if}">{$module_data.categories_name}</span></a>
                        </li>
                    {/foreach}
                </ul>
            </div>

        {/if}
    {/if}
{/block}