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
Menu Manager Help
- micahgodbolt
- Forum Members
- Posts: 149
- Joined: Thu Jul 29, 2010 11:09 pm
Re: Menu Manager Help
When I did a mega menu i left the menu template the same and just used CSS to style each dropdown differently.
Check out ***** for an example.
Check out ***** for an example.
Re: Menu Manager Help
Hi Micah,
Thanks! That works pretty well doesn't it. I have ended up doing the same and it works fine... It's not a bad way of doing it, but it bloats the CSS for no reason, and I was trying to cut down on the markup too (you know the whole "don't stick a div in there if you don't need one" idea).
Cheers
Marc
Thanks! That works pretty well doesn't it. I have ended up doing the same and it works fine... It's not a bad way of doing it, but it bloats the CSS for no reason, and I was trying to cut down on the markup too (you know the whole "don't stick a div in there if you don't need one" idea).
Cheers
Marc