{block name='snippets-filter-active-filter'}
{if $NaviFilter->getFilterCount() > 0}
    {$autoScrollTarget=$autoScrollTarget|default:''}
    {et_isShopVersionAtLeast value="5.1.0" assign='shopIsAtLeast51'}
    {et_isShopVersionAtLeast value="5.7.0-rc.3" assign='shopIsAtLeast57'}
    {block name='snippets-filter-active-filter-content'}
        {assign var='showTitle' value=$showTitle|default:false}
        <div class="active-filters">
            {if $showTitle}
                <div class="et-active-filters-title">{lang key="filter" section="global"}:</div>
            {/if}
            {foreach $NaviFilter->getActiveFilters() as $activeFilter}
                {assign var=activeFilterValue value=$activeFilter->getValue()}
                {assign var=activeValues value=$activeFilter->getActiveValues()}
                {if $activeFilterValue !== null}
                    {if is_array($activeValues)}
                        {foreach $activeValues as $filterOption}
                            {block name='snippets-filter-active-filter-values'}
                                {$href = "{$activeFilter->getUnsetFilterURL($filterOption->getValue())}{if !empty($autoScrollTarget)}{$autoScrollTarget}{/if}"}
                                <a
                                    {if $shopIsAtLeast57 && $Einstellungen.prgpattern.prg_pattern_enabled !== 'N'}
                                        data-prg-href="{$href|default:''|base64_encode}"
                                        href="#"
                                    {else}
                                        href="{$href}"
                                    {/if}
                                    rel="nofollow"
                                    title="{if $shopIsAtLeast51}{lang key='deleteFilter'}{else}{lang key='delete'}{/if}"
                                    class="filter-type-{$activeFilter->getNiceName()} snippets-filter-item et-active-filter">
                                    {* This is done due to a bug in JTL-Shop. ActiveFilters do not provide the actual property name in older versions but contain the frontend name of the active *value* *}
                                    {if $activeFilter->getNiceName() !== 'Characteristic'}
                                        <span class="et-active-filter-name">{$activeFilter->getFrontendName()}:</span>
                                    {elseif isset($Einstellungen.navigationsfilter.merkmal_label_anzeigen) && $Einstellungen.navigationsfilter.merkmal_label_anzeigen === 'Y'}
                                        <span class="et-active-filter-name">{$activeFilter->getFilterName()}:</span>
                                    {/if}
                                    <span class="et-active-filter-value">{$filterOption->getFrontendName()}</span><i class="{et_getIcon key="filterUnset"} snippets-filter-item-icon-left"></i>
                                </a>
                            {/block}
                        {/foreach}
                    {else}
                        {block name='snippets-filter-active-filter-value'}
                            {$href = "{$activeFilter->getUnsetFilterURL($activeFilter->getValue())}{if !empty($autoScrollTarget)}{$autoScrollTarget}{/if}"}
                            <a
                                {if $shopIsAtLeast57 && $Einstellungen.prgpattern.prg_pattern_enabled !== 'N'}
                                    data-prg-href="{$href|default:''|base64_encode}"
                                    href="#"
                                {else}
                                    href="{$href}"
                                {/if}
                                rel="nofollow"
                                title="{if $shopIsAtLeast51}{lang key='deleteFilter'}{else}{lang key='delete'}{/if}"
                                class="filter-type-{$activeFilter->getNiceName()} snippets-filter-item et-active-filter">
                                {* This is a bug in JTL-Shop (<= 5.1.1). ActiveFilters do not provide the actual property name but contain the frontend name of the active *value* *}
                                {if $activeFilter->getNiceName() !== 'Characteristic'}
                                    <span class="et-active-filter-name">{$activeFilter->getFrontendName()}:</span>
                                {elseif isset($Einstellungen.navigationsfilter.merkmal_label_anzeigen) && $Einstellungen.navigationsfilter.merkmal_label_anzeigen === 'Y'}
                                    <span class="et-active-filter-name">{$activeFilter->getFilterName()}:</span>
                                {/if}
                                <span class="et-active-filter-value">{$activeValues->getFrontendName()}</span><i class="{et_getIcon key="filterUnset"} snippets-filter-item-icon-left"></i>
                            </a>
                        {/block}
                    {/if}
                {/if}
            {/foreach}
            {if $NaviFilter->getURL()->getUnsetAll() !== null}
                {block name='snippets-filter-active-filter-remove'}
                    <a href="{$NaviFilter->getURL()->getUnsetAll()}{if !empty($autoScrollTarget)}{$autoScrollTarget}{/if}"
                        title="{lang key='removeFilters'}"
                        class='snippets-filter-item-all et-active-filter-clear'>
                        <span class="et-active-filter-name">{lang key='removeFilters'}</span><i class="{et_getIcon key="filterUnset"} snippets-filter-item-icon-left"></i>
                    </a>
                {/block}
            {/if}
        </div>
    {/block}
{/if}
{/block}
