{* Variables *}

{assign var="nbCategories" value=count($categories)}
{assign var="number" value=1}

{if isset($categorieParameter[0]->style) && $categorieParameter[0]->style == "categorie3"}
      {assign var="nbCol" value=12}
{else}
      {assign var="nbCol" value=12/count($categories)}
{/if}
      
{if isset($categorieParameter->style) && $categorieParameter[0]->style == "categorie2"}
      {assign var="nbColReaX2" value=($nbCol * 2)}
{else}
      {assign var="nbColReaX2" value=12}
{/if}

{* Block category *}
<div class="container category total-{$nbCategories} {$categorieParameter[0]->style}">
      <div class="row">
            {foreach from=$categories item=categorie}
                  {if $categorie->isVisible == true}
                        <div class="col-xs-12 col-sm-{$nbColReaX2} col-md-{$nbCol} box{$number} category-container-{$categorieParameter[0]->style}">
                              <div class="category-card">
                                    <img src="{$categorie->image}" alt="{$categorie->title}"/>   
                                    <div class="category-overlay">
                                          <span>{$categorie->subTitle}</span>
                                          <h2>{$categorie->title}</h2>                        
                                          <a href="{$categorie->url}" class="btn">Découvrir</a>
                                    </div>
                              </div>
                        </div>
                        {assign var="number" value=$number+1}
                  {/if}
            {/foreach}
      </div>
</div>


