Menu Manager Help
Posted: Thu Nov 17, 2011 11:51 am
Hi,
I am having a minor issue with a custom menu manager template, and I was wondering whether anybody could help. I'm fairly sure it's simple, but cannot seem to work it out!
Basically I am trying to create a "mega-menu" type drop down, but only want it on one of the main nav links. To do this effectively I am trying to set up the menu manager to create the following:
<ul>
<li>
<a></a>
<ul>Normal Drop Down in here</ul>
</li>
<li>
<a></a>
<div class="mega">
<ul>Mega Drop Down in here</ul>
</div>
</li>
</ul>
I have amended the include simple template to insert the div on all sub ULs, like this:
{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
{repeat string='<div class="mega clearfix"><ul class="clearfix">' times=$node->depth-$node->prevdepth}
{elseif $node->depth < $node->prevdepth}
{repeat string="</li></ul></div><!-- .mega -->" times=$node->prevdepth-$node->depth}
Which works fine and I have managed to get the mega drop down looking spot on, however, I need to only apply the drop down to one specific drop down, so I tried the following (and various alternatives to this too):
{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
{if $node->alias == "services"}
{repeat string='<div class="sub clearfix">' times=$node->depth-$node->prevdepth}
{/if}
{repeat string='<ul class="clearfix">' times=$node->depth-$node->prevdepth}
{elseif $node->depth < $node->prevdepth}
{repeat string="</li></ul>" times=$node->prevdepth-$node->depth}
{if $node->alias == "services"}
{repeat string="</div><!-- .sub -->" times=$node->prevdepth-$node->depth}
{/if}
But it breaks the menu completely.
Has any body got any ideas?
Thanks
Marc
I am having a minor issue with a custom menu manager template, and I was wondering whether anybody could help. I'm fairly sure it's simple, but cannot seem to work it out!
Basically I am trying to create a "mega-menu" type drop down, but only want it on one of the main nav links. To do this effectively I am trying to set up the menu manager to create the following:
<ul>
<li>
<a></a>
<ul>Normal Drop Down in here</ul>
</li>
<li>
<a></a>
<div class="mega">
<ul>Mega Drop Down in here</ul>
</div>
</li>
</ul>
I have amended the include simple template to insert the div on all sub ULs, like this:
{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
{repeat string='<div class="mega clearfix"><ul class="clearfix">' times=$node->depth-$node->prevdepth}
{elseif $node->depth < $node->prevdepth}
{repeat string="</li></ul></div><!-- .mega -->" times=$node->prevdepth-$node->depth}
Which works fine and I have managed to get the mega drop down looking spot on, however, I need to only apply the drop down to one specific drop down, so I tried the following (and various alternatives to this too):
{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
{if $node->alias == "services"}
{repeat string='<div class="sub clearfix">' times=$node->depth-$node->prevdepth}
{/if}
{repeat string='<ul class="clearfix">' times=$node->depth-$node->prevdepth}
{elseif $node->depth < $node->prevdepth}
{repeat string="</li></ul>" times=$node->prevdepth-$node->depth}
{if $node->alias == "services"}
{repeat string="</div><!-- .sub -->" times=$node->prevdepth-$node->depth}
{/if}
But it breaks the menu completely.
Has any body got any ideas?
Thanks
Marc