Somehow, I cannot get this piece of Smarty code to work as required:
{assign var='number_of_levels' value=2}
{if isset($menuparams.number_of_levels)}
{assign var='number_of_levels' value=$menuparams.number_of_levels}
{/if}
{if $count > 0}
<div id="sbi_container" class="sbi_container">
{foreach from=$nodelist item=node}
{if $node->depth == 1}
<div class="sbi_panel" data-bg="images/3.jpg">
<a href="#" class="sbi_label">{$node->menutext}</a>
<div class="sbi_content">
<ul>
{/if}
{if $node->depth > 1}
<li><a href="{$node->url}">{$node->menutext}</a></li>
{/if}
{if $node->depth == 1 && $node->depth < $node->prevdepth}
</ul>
</div>
</div>
{/if}
{/foreach}
</div>
{/if}
Desired output looks like this:
<div id="sbi_container" class="sbi_container">
<div class="sbi_panel" data-bg="images/3.jpg">
<a href="#" class="sbi_label">Web / Smartphones</a>
<div class="sbi_content">
<ul>
<li><a href="#">Subitem</a></li>
<li><a href="#">Subitem</a></li>
<li><a href="#">Subitem</a></li>
</ul>
</div>
</div>
<div class="sbi_panel" data-bg="images/4.jpg">
<a href="#" class="sbi_label">Brothers</a>
<div class="sbi_content">
<ul>
<li><a href="#">Subitem</a></li>
<li><a href="#">Subitem</a></li>
<li><a href="#">Subitem</a></li>
</ul>
</div>
</div>
<div class="sbi_panel" data-bg="images/5.jpg">
<a href="#" class="sbi_label">Video / Scripts</a>
<div class="sbi_content">
<ul>
<li><a href="#">Subitem</a></li>
<li><a href="#">Subitem</a></li>
<li><a href="#">Subitem</a></li>
</ul>
</div>
</div>
</div>
Filling the content is not a problem, but I fail to recreate the hierarchical order with div / ul / li elements. The menu has two levels only.
Please help, I feel stupid not to be able to do that myself. Thanks a looot!
OK, here is what I was looking for. The structure is somehow counter-intuitive, but it fits my needs perfectly: