{extends file="widgets/base/widget.tpl"}

{strip}
    {block name="et-widget-container-inner"}
        <div class="row news-category-content-wrapper">
            <div class="col-12 order-1{if $et_NewsCategoryContent.showNavigation} order-md-2 col-md-9{/if}">
                {block name='news-category-content-overview'}
                    {include file='blog/overview.tpl' lazyLoadImages=$et_BaseWidget.lazyLoadImages}
                {/block}
            </div>
            {if $et_NewsCategoryContent.showNavigation}
                <div class="col-12 col-md-3 order-2 mt-2 mt-md-0 order-md-1">
                    {if $Einstellungen.news.news_benutzen === 'Y' && isset($oNewsKategorie_arr) && count($oNewsKategorie_arr) > 0}
                        {$newsEntryLimitPerCategory=5}
                        {block name='et-news-category-content-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='et-news-category-content-news-categories-content'}
                                            <div class="row">
                                                {foreach $oNewsKategorie_arr as $oNewsKategorie}
                                                    <div class="col-12">
                                                        {if is_a($oNewsKategorie, 'JTL\News\Category')}
                                                            <strong><a href="{$oNewsKategorie->getURL()}" class="link-discreet" title="{$oNewsKategorie->getName()|strip_tags|escape:'html'}">{$oNewsKategorie->getName()}</a></strong>
                                                            {if $oNewsKategorie->getItems() !== null && count($oNewsKategorie->getItems()) > 0}
                                                                <ul class="list-unstyled">
                                                                    {foreach from=$oNewsKategorie->getItems() item='oNews' name='categoryNews'}
                                                                        {if $smarty.foreach.categoryNews.index < $newsEntryLimitPerCategory}
                                                                            <li>&nbsp;&nbsp;<a href="{$oNews->getURL()}" class="link-discreet">{$oNews->getTitle()}</a></li>
                                                                        {/if}
                                                                        {if $smarty.foreach.categoryNews.index === $newsEntryLimitPerCategory}
                                                                            <li class="et-news-category-navigation-more">&nbsp;&nbsp;&nbsp;<a href="{$oNewsKategorie->getURL()}" class="link-discreet" title="{$oNewsKategorie->getName()|strip_tags|escape:'html'}">{lang key="more" section="global"}</a></li>
                                                                        {/if}
                                                                    {/foreach}
                                                                </ul>
                                                            {/if}
                                                        {else}
                                                            <strong><a href="{$oNewsKategorie->cURLFull}" class="link-discreet" title="{$oNewsKategorie->cName|strip_tags|escape:'html'}">{$oNewsKategorie->cName}</a></strong>
                                                        {/if}
                                                    </div>
                                                {/foreach}
                                            </div>
                                        {/block}
                                    </div>
                                </div>
                            </div>
                        {/block}
                    {/if}
                    <div class="card sitemap-group">
                        <div class="card-header">{lang key='sitemapSites'}</div>
                        <div class="card-body">
                            {block name='et-news-category-content-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-12">
                                                <ul class="nav flex-column">
                                                    {block name='et-news-category-content-include-linkgroup-list'}
                                                        {include file='snippets/linkgroup_list.tpl' linkgroupIdentifier=$linkgroup->getTemplate() tplscope='sitemap'}
                                                    {/block}
                                                </ul>
                                            </div>
                                        {/if}
                                    {/foreach}
                                </div>
                            {/block}
                        </div>
                    </div>
                </div>
            {/if}
        </div>
    {/block}
{/strip}