{if not $fromCache}
   {$filterItem = "{t}kategorie{/t}"}
   {$body.dynamic_filter.sections = $body.dynamic_filter.filter->getSections(array_map(f_call('getId'), $categories))}
   <div class="filter-row filter-{$filterItem}">
      <button type="button" class="filter-label" data-opener="[data-opener-{$filterItem}]">{t}Kategorie{/t}</button>
      <div class="opener-content" data-opener-{$filterItem}>
         <div class="opener-content-inner">
            {foreach $body.dynamic_filter.sections.values as $value}
               {if $body.category.id or $value.id <= 4} {* pokud vypisuju nultou uroven, chci vypsat jen hlavni 4 kategorie *}
                  <label class="custom-checkbox custom-control check-{$value.id}" for="filter_{$filterItem}_{$value.id}">
                     <input class="custom-control-input" type="checkbox" name="dynamic_filter[sectionIDsFilter][]" value="{$value.id}"
                            data-filter-input="{$filterItem}" id="filter_{$filterItem}_{$value.id}"
                             {if $dbcfg.analytics.google_tag_manager.gtm_dl_version == '2'}
                                data-tracking-filter="{['event'=>'applyFilterParams','filtrName'=>'kategorie','filtrId'=>'','filtrValue'=>['name'=>$value.name,'id'=>$value.id,'value'=>'','min'=>'','max'=>'','active'=>'']]|json_encode}"
                             {/if}
                     >
                     <span class="custom-control-indicator"></span>
                     <span class="custom-control-text">
                         {$value.name} <small>(<span class="filter-count" data-filter-count="{$value.id}">{$value.count}</span>)</small>
                     </span>
                  </label>
               {/if}
            {/foreach}
         </div>
      </div>
   </div>
{/if}
