{block name='snippets-linkgroup-list'}
    {et_isShopVersionAtLeast value="5.2.0-beta" assign='shopIsAtLeast52'}
    {if isset($linkgroupIdentifier)}
    {strip}
        {assign var=checkLinkParents value=false}
        {if isset($Link) && $Link->getID() > 0}
            {assign var=activeId value=$Link->getID()}
        {elseif JTL\Shop::$kLink > 0}
            {assign var=activeId value=JTL\Shop::$kLink}
            {assign var=Link value=JTL\Shop::Container()->getLinkService()->getLinkByID($activeId)}
        {/if}
        {if !isset($activeParents) && (isset($Link))}
            {if !empty($activeId)}
                {assign var=activeParents value=JTL\Shop::Container()->getLinkService()->getParentIDs($activeId)}
            {else}
                {assign var=activeParents value=[]}
            {/if}
            {assign var=checkLinkParents value=true}
        {/if}
        {get_navigation linkgroupIdentifier=$linkgroupIdentifier assign='links'}
        {if !empty($links)}
            {block name='snippets-linkgroup-list-links'}
                {foreach $links as $li}
                    {if $li->getChildLinks()->count() > 0 && isset($dropdownSupport)}
                        {block name='snippets-linkgroup-list-links-dropdown'}
                            <li class="link-group-item nav-item nav-scrollbar-item dropdown dropdown-full{if $activeId == $li->getId()} active{/if}">
                                <a href="{$li->getURL()}" title="{$li->getName()}" class="nav-link dropdown-toggle et-dropdown-toggle" target="_self" aria-expanded="false" aria-controls="dropdown-menu-link-{$li->getId()}">
                                    <span class="text-truncate">{$li->getName()}</span>
                                    <i class='{et_getIcon key="dropdownOpen"} et-dropdown-open'></i><i class='{et_getIcon key="dropdownClosed"} et-dropdown-closed'></i>
                                </a>
                                <div class="dropdown-menu" id="dropdown-menu-link-{$li->getId()}">
                                    <div class="dropdown-body">
                                        <div class="container subcategory-wrapper">
                                            <div class="row lg-row-lg nav">
                                                <div class="col col-lg-4 col-xl-3 nav-item-lg-m nav-item dropdown d-lg-none">
                                                    {block name='snippets-linkgroup-list-links-header'}
                                                        <a href="{$li->getURL()}" title="{$li->getName()}"{if $li->getNoFollow()} rel="nofollow"{/if}{if $shopIsAtLeast52} target="{$li->getTarget()}"{/if}>
                                                            <strong class="nav-mobile-heading">{lang key='menuShow' printf=$li->getName()}</strong>
                                                        </a>
                                                    {/block}
                                                </div>
                                                {foreach $li->getChildLinks() as $subli}
                                                    <div class="col col-lg-4 col-xl-3 nav-item-lg-m nav-item">
                                                        {block name='snippets-linkgroup-list-links-sublinks'}
                                                            {if !empty($subli->getName())}
                                                                <a href="{$subli->getURL()}"{if $subli->getNoFollow()} rel="nofollow"{/if}{if $shopIsAtLeast52} target="{$subli->getTarget()}"{/if} class="submenu-headline submenu-headline-toplevel nav-link">
                                                                    {$subli->getName()}
                                                                </a>
                                                            {/if}
                                                        {/block}
                                                    </div>
                                                {/foreach}
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </li>
                        {/block}
                    {else}
                        {block name='snippets-linkgroup-list-links-navitem'}
                            <li class="nav-item nav-scrollbar-item {if !empty($activeId) && $activeId == $li->getId()}active{/if}">
                                <a href="{$li->getURL()}" class="link-discreet"{if $li->getNoFollow()} rel="nofollow"{/if}{if $shopIsAtLeast52} target="{$li->getTarget()}"{/if}>
                                    {$li->getName()}
                                </a>
                            </li>
                        {/block}
                    {/if}
                {/foreach}
            {/block}
        {/if}
    {/strip}
    {/if}
{/block}
