Subcategories display in main category

Hello friends,



I am changing my category page and want to display the subcategories from the subcategories on the main category.

See the image below to understand this:







This is my code:



```php



{foreach from=$subcategories item="category"}
{if $category}

{else}

{/if}
{/foreach}

{/foreach}



{split data=$subcategories size=$columns|default:"2" assign="splitted_categories"}
{math equation="floor(100/x)" x=$columns|default:"2" assign="cell_width"}

{foreach from=$splitted_categories item="subcategories"}









{assign var=darin value=$category.category_id}
{php}
$smarty_var = $this->get_template_vars('darin');
$cat_var = fn_get_image_pairs($smarty_var, 'category', 'M', true, false);
$this->assign('category_image', $cat_var);
{/php}

{if empty($category_image.icon.image_path)}
{$category_image.icon.alt}
{else}
{$category_image.icon.alt}
{/if}







// The sub-subcategories should come here... //









>

```


As you can see there is half way a empty space that is reserved for the sub-subcategories.

Can someone help me with this? I would be very grateful.

Thanks in advance,

dennis