1
Hello,
I would like to modify the core menu templates which in there standard state utilise tables. I intend to use an unordered list structure in replace of this:
<ul id="mainmenu">
<{foreach item=module from=$block.modules}>
<li><a class="menuMain" href="<{$xoops_url}>/modules/<{$module.directory}>/"><{$module.name}>a>li>
<ul>
<{foreach item=sublink from=$module.sublinks}>
<li><a class="menuSub" href="<{$sublink.url}>"><{$sublink.name}>a>li>
<{/foreach}>
ul>
<{/foreach}>
ul>
The problem with the above code is that if a menu item doesn't have an attached submenu, it leaves unused
< ul > tags in the markup which I don't want.
E.g.
<ul id="mainmenu">
<li>menu 1li>
[b]<ul>
ul>[/b]
<li>menu 2li>
<ul>
<li>sub 1li>
<li>sub 2li>
<li>sub 3li>
ul>
ul>
Does anyone know how to include a conditional statement that says something like
if (there is a submenu) show < ul > tags else hide them, or any other solution?