How to access the subcategories in Smarty template?

I want to reimplement the main menu by changing one of the built-in Shopware’s .tpl files. I need to get the subcategries of each main category and so on (subcategories of a subcategory, if exists, etc.) How can I do this? I know that I have immediate access to $sMainCategories in smarty, but when I try to access subcategories by:
{foreach $sMainCategory as $mc}

{foreach $mc.subcategories as $sc}

{$sc}

{/foreach}

{/foreach}

I don’t get anything, and when I output the variable {$mc.subcategories} , by using {$mc.subcategories@print_r} ,I get an empty array. I know that there are subcategories in that maincategory, and all categories and subcategories are active. Why can’t I access subcategories of a category in smarty template?

 

It isn’t called $sMainCategory but $sMainCategories.

@steinsoftware schrieb:

It isn’t called $sMainCategory but $sMainCategories.

It seems that $sMainCategories as well as $sCategories lack all the subcategories except the one of the current $sMainCategory and of the categories that are on direct path to the “tail”-Category of the product. However, if we activate the Advanced Menu plugin and configure it appropriately (the number of levels of subcategories to show), we get $sAdvancedMenu with all the required information.