<{if $section.categories}> <{$categories = $webshop->getCategoriesByIds($section.categories)}> <{else}> <{$categories = $webshop->getAllCategories()}> <{/if}> <{$max = $section.max|default:999}> <{$shown = []}> <{$shown_count = 0}> <{foreach $categories as $cat}> <{if $cat && !$cat->isFront() && $shown_count < $max}><{$shown[] = $cat}><{$shown_count = $shown_count + 1}><{/if}> <{/foreach}> <{if $shown}>
<{include file="components/section-heading.html" heading_title=$section.title heading_lead="" heading_align="center"}> <{if $section.layout == 'links'}>
<{foreach $shown as $cat}> <{$cat->getName()|escape}> <{/foreach}>
<{else}>
<{foreach $shown as $cat}> <{include file="components/category-card.html" cat=$cat}> <{/foreach}>
<{/if}>
<{/if}>