{block name='page-sitemap'}
    {$columnLayout="col-12 col-sm-6 col-md-4 col-lg-3"}
    {et_isShopVersionAtLeast value="5.2.0-beta" assign='shopIsAtLeast52'}
    {if $Einstellungen.sitemap.sitemap_seiten_anzeigen === 'Y'}
        {block name='page-sitemap-pages'}
            {opcMountPoint id='opc_before_pages' inContainer=true}
            <div class="sitemap-wrapper-linkgroup">
                <div class="card sitemap-group">
                    <div class="card-header">{lang key='sitemapSites'}</div>
                    <div class="card-body">
                        {block name='page-sitemap-pages-content'}
                            <div class="row">
                                {foreach $linkgroups as $linkgroup}
                                    {if !empty($linkgroup) && !empty($linkgroup->getName()) && $linkgroup->getName() !== 'hidden' && !empty($linkgroup->getLinks()) && !$linkgroup->getLinks()->isEmpty()}
                                        <div class="col {$columnLayout}">
                                            <ul class="nav flex-column">
                                                {block name='page-sitemap-include-linkgroup-list'}
                                                    {include file='snippets/linkgroup_list.tpl' linkgroupIdentifier=$linkgroup->getTemplate() tplscope='sitemap'}
                                                {/block}
                                            </ul>
                                        </div>
                                    {/if}
                                {/foreach}
                            </div>
                        {/block}
                    </div>
                </div>
            </div>
        {/block}
    {/if}
    {if $Einstellungen.sitemap.sitemap_kategorien_anzeigen === 'Y' && isset($oKategorieliste->elemente) && count($oKategorieliste->elemente) > 0}
        {block name='page-sitemap-categories'}
            {opcMountPoint id='opc_before_categories' inContainer=true}
            <div class="sitemap-wrapper-categories">
                <div class="card sitemap-group">
                    <div class="card-header">{lang key='sitemapKats'}</div>
                    <div class="card-body">
                        {block name='page-sitemap-categories-content'}
                            <div class="row">
                                {foreach $oKategorieliste->elemente as $oKategorie}
                                    {if count($oKategorie->getChildren()) > 0}
                                        <div class="col {$columnLayout}">
                                            <ul class="list-unstyled">
                                                <li>
                                                    <a href="{$oKategorie->getURL()}" title="{$oKategorie->getName()|escape:'html'}" class="link-discreet">
                                                        <strong>{$oKategorie->getShortName()}</strong>
                                                    </a>
                                                </li>
                                                {foreach $oKategorie->getChildren() as $oSubKategorie}
                                                    <li>
                                                        <a href="{$oSubKategorie->getURL()}" title="{$oSubKategorie->getName()|escape:'html'}" class="link-discreet">
                                                            {$oSubKategorie->getShortName()}
                                                        </a>
                                                    </li>
                                                    {if $oSubKategorie->getChildren() !== null && count($oSubKategorie->getChildren()) > 0}
                                                        <li>
                                                            <ul class="sub-categories list-unstyled">
                                                                {foreach $oSubKategorie->getChildren() as $oSubSubKategorie}
                                                                    <li>
                                                                        <a href="{$oSubSubKategorie->getURL()}"
                                                                        title="{$oSubSubKategorie->getName()|escape:'html'}" class="link-discreet">
                                                                            {$oSubSubKategorie->getShortName()}
                                                                        </a>
                                                                    </li>
                                                                {/foreach}
                                                            </ul>
                                                        </li>
                                                    {/if}
                                                {/foreach}
                                            </ul>
                                        </div>
                                    {/if}
                                {/foreach}

                                <div class="col {$columnLayout}">
                                    <ul class="list-unstyled">
                                        {foreach $oKategorieliste->elemente as $oKategorie}
                                            {if $oKategorie->getChildren() !== null && count($oKategorie->getChildren()) == 0}
                                                <li>
                                                    &nbsp;&nbsp;<a href="{$oKategorie->getURL()}" title="{$oKategorie->getName()|escape:'html'}" class="link-discreet">
                                                        {$oKategorie->getShortName()}
                                                    </a>
                                                </li>
                                            {/if}
                                        {/foreach}
                                    </ul>
                                </div>
                            </div>
                        {/block}
                    </div>
                </div>
            </div>
        {/block}
    {/if}
    {if $Einstellungen.sitemap.sitemap_hersteller_anzeigen === 'Y' && isset($oHersteller_arr) && count($oHersteller_arr) > 0}
        {block name='page-sitemap-manufacturer'}
            {opcMountPoint id='opc_before_manufacturers' inContainer=true}
            <div class="sitemap-wrapper-manufacturer">
                <div class="card sitemap-group">
                    <div class="card-header">{lang key='sitemapNanufacturer'}</div>
                    <div class="card-body">
                        {block name='page-sitemap-manufacturer-content'}
                            <div class="row">
                                {foreach $oHersteller_arr as $oHersteller}
                                    <div class="col {$columnLayout} sitemap-group-item">
                                        {if $shopIsAtLeast52}
                                            <a href="{$oHersteller->getURL()}"  class="link-discreet">{$oHersteller->getName()}</a>
                                        {else}
                                            <a href="{$oHersteller->cURL}"  class="link-discreet">{$oHersteller->cName}</a>
                                        {/if}
                                    </div>
                                {/foreach}
                            </div>
                        {/block}
                    </div>
                </div>
            </div>
        {/block}
    {/if}
    {if $Einstellungen.news.news_benutzen === 'Y' && $Einstellungen.sitemap.sitemap_news_anzeigen === 'Y' && !empty($oNewsMonatsUebersicht_arr) && count($oNewsMonatsUebersicht_arr) > 0}
        {block name='page-sitemap-news'}
            {opcMountPoint id='opc_before_news' inContainer=true}
            <div class="sitemap-wrapper-news">
                <div class="card sitemap-group">
                    <div class="card-header">{lang key='sitemapNews'}</div>
                    <div class="card-body">
                        {block name='page-sitemap-news-content'}
                            <div class="row">
                                {foreach $oNewsMonatsUebersicht_arr as $oNewsMonatsUebersicht}
                                    {if isset($oNewsMonatsUebersicht->oNews_arr) && count($oNewsMonatsUebersicht->oNews_arr) > 0}
                                        {math equation='x-y' x=$oNewsMonatsUebersicht@iteration y=1 assign='i'}
                                        <div class="col {$columnLayout}">
                                            <strong><a href="{$oNewsMonatsUebersicht->cURLFull}" class="link-discreet">{$oNewsMonatsUebersicht->cName}</a></strong>
                                            <ul class="list-unstyled">
                                                {foreach $oNewsMonatsUebersicht->oNews_arr as $oNews}
                                                    <li>&nbsp;&nbsp;<a href="{$oNews->cURLFull}" class="link-discreet">{$oNews->cBetreff}</a></li>
                                                {/foreach}
                                            </ul>
                                        </div>
                                    {/if}
                                {/foreach}
                            </div>
                        {/block}
                    </div>
                </div>
            </div>
        {/block}
    {/if}
    {if $Einstellungen.news.news_benutzen === 'Y'
        && $Einstellungen.sitemap.sitemap_newskategorien_anzeigen === 'Y'
        && isset($oNewsKategorie_arr) && count($oNewsKategorie_arr) > 0
    }
        {block name='page-sitemap-news-categories'}
            {opcMountPoint id='opc_before_news_categories' inContainer=true}
            <div class="sitemap-wrapper-news-categories">
                <div class="card sitemap-group">
                    <div class="card-header">{lang key='sitemapNewsCats'}</div>
                    <div class="card-body">
                        {block name='page-sitemap-news-categories-content'}
                            <div class="row">
                                {foreach $oNewsKategorie_arr as $oNewsKategorie}
                                    {if isset($oNewsKategorie->oNews_arr) && count($oNewsKategorie->oNews_arr) > 0}
                                        <div class="col {$columnLayout}">
                                            <strong><a href="{$oNewsKategorie->cURLFull}">{$oNewsKategorie->cName}</a></strong>
                                            <ul class="list-unstyled">
                                                {foreach $oNewsKategorie->oNews_arr as $oNews}
                                                    <li>
                                                        &nbsp;&nbsp;<a href="{$oNews->cURLFull}" class="link-discreet">{$oNews->cBetreff}</a>
                                                    </li>
                                                {/foreach}
                                            </ul>
                                        </div>
                                    {/if}
                                {/foreach}
                            </div>
                        {/block}
                    </div>
                </div>
            </div>
        {/block}
    {/if}
{/block}
