Adding a class to first child on drop down menu

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
lchestnut
Forum Members
Forum Members
Posts: 20
Joined: Fri Dec 23, 2011 5:00 am

Adding a class to first child on drop down menu

Post 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
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

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

Post 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?...
lchestnut
Forum Members
Forum Members
Posts: 20
Joined: Fri Dec 23, 2011 5:00 am

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

Post 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
Attachments
6-15-2012 6-50-59 PM.png
6-15-2012 6-50-59 PM.png (43.79 KiB) Viewed 2132 times
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

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

Post 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...
Post Reply

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