Page 1 of 1

Adding a class to first child on drop down menu

Posted: Fri Jun 15, 2012 7:05 pm
by lchestnut
I am porting a template to CMSMS and I am having an issue with getting the menu to display properly.

http://simpledesign.peppermgmt.com

I am using a copy of the minimal menu as follows:

Code: Select all

{if $count > 0}
<ul class="dd-menu">
{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 class="current-menu-item"><a href="{$node->url}" {if $node->target ne ""} target="{$node->target}"{/if}> {$node->menutext} </a>

{elseif $node->parent == true && $node->depth == 1 and $node->type != 'sectionheader' and $node->type != 'separator'}
<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 need to add a class of "arrow" on the first child only in the dropdown menu which adds an image. Everything I have tried hasnt worked. Can you point me in the right direction?

Thanks

Lisa

Re: Adding a class to first child on drop down menu

Posted: Fri Jun 15, 2012 10:49 pm
by Dr.CSS
I would first off use a copy of the cssmenu template as it is made to work with drop down type menus...

Now if maybe you could give an example of what your trying to do, an image or a little more detail in post, the first child of the drop down or the top menu item that has children?...

Re: Adding a class to first child on drop down menu

Posted: Fri Jun 15, 2012 11:59 pm
by lchestnut
Ok. I did make a copy of the minimal menu should I use the cssmenu instead?

I have an image that goes at the top of the first child of the drop down. I have attached an image to show how it is supposed to look.

I appreciate your help. I am still learning how to apply all of the css styles to the different parts of a menu.

Lisa

Re: Adding a class to first child on drop down menu

Posted: Sun Jun 17, 2012 5:45 pm
by Dr.CSS
For that I would use the same menu template used here...

http://multiintech.com/defaultcontent/d ... lumns.html

That is the same one used for the next page, and the home page menu...