modifying menumanager templates [SOLVED]

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
davids355
Power Poster
Power Poster
Posts: 279
Joined: Fri Apr 04, 2008 10:08 am

modifying menumanager templates [SOLVED]

Post by davids355 »

I am having trouble implimenting a drop-down menu into my cmsms.

I have a working dropdown menu which is this:

Code: Select all

<div class="menu">

<ul>
<li><a href="../menu/index.html">DEMOS</a></li>

<li><a href="../boxes/index.html">BOXES<!--[if IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
	<ul>
	<li><a href="spies.html">Second level 1</a></li>
	<li><a href="vertical.html">Second level 2</a></li>
	
	</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
</li>
<li><a href="../mozilla/index.html">MOZILLA</a></li>

<li><a href="../ie/index.html">EXPLORER</a></li>

<li><a href="../opacity/index.html">OPACITY</a></li>
</ul>
And I am working with the minimal_menu.tpl file which is this:

Code: Select all

{* CSS classes used in this template:
.currentpage - The active/current page
.bullet_sectionheader - To style section header
hr.separator - To style the ruler for the separator *} 
{if $count > 0}
<ul>
{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
{repeat string="<ul>" times=$node->depth-$node->prevdepth}
{elseif $node->depth < $node->prevdepth}
{repeat string="</li></ul>" times=$node->prevdepth-$node->depth}
</li>
{elseif $node->index > 0}</li>
{/if}

{if $node->current == true}
<li><a href="{$node->url}" class="currentpage"{if $node->target ne ""} target="{$node->target}"{/if}>{$node->menutext}</a>


{elseif $node->parent == true && $node->depth == 1}
<li class="activeparent"><a href="{$node->url}" class="activeparent"{if $node->target ne ""} target="{$node->target}"{/if}>{$node->menutext}</a>


{elseif $node->type == 'sectionheader'}
<li class="sectionheader">{$node->menutext}

{elseif $node->type == 'separator'}
<li style="list-style-type: none;"> <hr class="separator" />

{else}
<li><a href="{$node->url}"{if $node->target ne ""} target="{$node->target}"{/if}>{$node->menutext}</a>

{/if}

{/foreach}

{repeat string="</li></ul>" times=$node->depth-1}</li>
</ul>
{/if}
I can get the first level menu to display fine, see here:
http://www.shareworld.co.uk/index.php?page=test

However, for the second level links, I need this code present:

Code: Select all

<li><a href="../boxes/index.html">BOXES<!--[if IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
But in the minimal menu template, there is nothing to differentiate between code in-between and for the second level links only.

Does anyone have an idea of how I could do this?

Many thanks

In advance...
Last edited by davids355 on Sat Nov 29, 2008 10:48 am, edited 1 time in total.
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm

Re: modifying menumanager templates

Post by Nullig »

Make sure you have:





in the section of your template.

Nullig
Dee
Power Poster
Power Poster
Posts: 1197
Joined: Sun Mar 19, 2006 8:46 pm

Re: modifying menumanager templates

Post by Dee »

In the template you can use $node->depth to determine the "level" of the links.
If you need that block only for the "boxes" page use $node->alias

Code: Select all

{if $node->alias == 'blocks'}
<!--[if IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
	<ul>
	<li><a href="spies.html">Second level 1</a></li>
	<li><a href="vertical.html">Second level 2</a></li>
	
	</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
{/if}
See this post for some more information about converting an existing menu to menu manager.

Regards,
D
davids355
Power Poster
Power Poster
Posts: 279
Joined: Fri Apr 04, 2008 10:08 am

Re: modifying menumanager templates

Post by davids355 »

Thanks for the help you two. I ended up finding a bit of code from cssmenu.tpl :

{if $node->haschildren == true}

which done the job. Have a look at my dropdown here:
http://www.shareworld.co.uk

the menu itself is courtasy of http://www.cssplay.co.uk

Many thanks

Dave
Dee
Power Poster
Power Poster
Posts: 1197
Joined: Sun Mar 19, 2006 8:46 pm

Re: modifying menumanager templates [SOLVED]

Post by Dee »

davids355 wrote: {if $node->haschildren == true}

which done the job. Have a look at my dropdown here:
http://www.shareworld.co.uk
I was wondering how you got the ending conditional statements for IE6 in the right place:

Code: Select all

<!--[if lte IE 6]></td></tr></table></a><![endif]-->
See also this post.
Maybe you could post your menu template?

Regards,
D
Post Reply

Return to “Layout and Design (CSS & HTML)”