[Solved] Need some help customizing my 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
The Shadow
Forum Members
Forum Members
Posts: 22
Joined: Sun Apr 04, 2010 5:37 pm

[Solved] Need some help customizing my menu

Post by The Shadow »

I want to add a greater than sign to all of the parent items that have children, but only on the drop-down menu; not on the main menu.  This string of CSS I that I want to add, >  

This is how I would like the menu to look like.  I just don't know what the main menu items are called.

Image

My menu template looks like this:

Code: Select all

{if $count > 0}
<ul id="nav" class="sf-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->parent == true or ($node->current == true and $node->haschildren == true)}
<li><a href="{$node->url}" {if $node->target}onclick="target='newwindow'" {/if}>{$node->menutext}</a>

{elseif $node->haschildren == true and $node->type != 'sectionheader' and $node->type != 'separator'}
<li><a href="{$node->url}" {if $node->target}onclick="target='newwindow'" {/if}>{$node->menutext}</a>

{elseif $node->current == true}
<li><a href="{$node->menutext}">{$node->menutext}</a>

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

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

{/if}

{/foreach}
{repeat string="</li></ul>" times=$node->depth-1}</li>
</ul>
{/if}

Last edited by The Shadow on Mon Jul 19, 2010 8:27 pm, edited 1 time in total.
The Shadow
Forum Members
Forum Members
Posts: 22
Joined: Sun Apr 04, 2010 5:37 pm

Re: Need some help customizing my menu

Post by The Shadow »

So there's no way how to this via the Menu Manager?

If making my menu template look like this:

Code: Select all

{elseif $node->haschildren == true and $node->type != 'sectionheader' and $node->type != 'separator'}
<li><a href="{$node->url}" {if $node->target}onclick="target='newwindow'" {/if}>{$node->menutext} ></a>
Then my menu will like like this:

Image

But when if I were to add >

Then my menu will like this (which is not what I want):

Image
uniqu3

Re: Need some help customizing my menu

Post by uniqu3 »

Not tested but you could try

Code: Select all

{elseif $node->haschildren == true and $node->depth == 2}
<li><a href="{$node->url}" {if $node->target}onclick="target='newwindow'" {/if}>{$node->menutext} <span style="float:right;">></span></a>
But it can also be done with CSS

for example

Code: Select all

.yourmenuclass li a span.classforspan /*First level */{
 visibility:hidden;
 float:right;}

.yourmenuclass li li a span.classforspan /*Second level*/ {
 visibility:visible;}
Last edited by uniqu3 on Thu Jul 15, 2010 12:07 pm, edited 1 time in total.
The Shadow
Forum Members
Forum Members
Posts: 22
Joined: Sun Apr 04, 2010 5:37 pm

Re: Need some help customizing my menu

Post by The Shadow »

Code: Select all

{elseif $node->haschildren == true and $node->depth >= 2}
<li><a href="{$node->url}" {if $node->target}onclick="target='newwindow'" {/if}>{$node->menutext} <span style="float:right;">></span></a>
Worked perfectly!!!  I changed the $node->depth == 2 to $node->depth >= 2 that way if I do another level depth, then it will have a > sign.  If I just left it as $node->depth == 2 then only the second level would have a > sign.

Major thanks!

My web site is located here
The Shadow
Forum Members
Forum Members
Posts: 22
Joined: Sun Apr 04, 2010 5:37 pm

Re: Need some help customizing my menu

Post by The Shadow »

I thought that my menu was finished, but when I tried my site in IE6 and IE7 the menu looks like this:

Image

My menu looks great in IE8, FireFox 3.6.4, Safari 5, Opera 10.60, and Chrome 5; just not in IE6 (figures) and IE7.  So what is the best way to resolve this issue?
Ziggywigged
Power Poster
Power Poster
Posts: 424
Joined: Sat Feb 02, 2008 12:42 am

Re: Need some help customizing my menu

Post by Ziggywigged »

You might have to add those as images for best results.
Take a penny, leave a penny.
uniqu3

Re: Need some help customizing my menu

Post by uniqu3 »

Actually IE6 is the only one showing this correctly by logic.

For example:
li is styled to wrap link -->
link has display:block means width100% and no float --> Tuition
means span element gets pushed by display block property --> >
You gave width to element, not sure didn't test it but you could try placing outside and play with width.
owr_bgld

Re: Need some help customizing my menu

Post by owr_bgld »

Ziggywigged wrote: You might have to add those as images for best results.
I also think it's the best solution.
make the '>' as picture and background. no-repeat and position right center should work

but maybe you chould think about the different colors (for hover pe.)

But maybe also this works:
>Tuition

I had someimes success by putting the right before the left. but don't aksk me why ::) 8)
Last edited by owr_bgld on Mon Jul 19, 2010 5:19 pm, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Need some help customizing my menu

Post by Dr.CSS »

When floating right the thing after it will go left everything on the web starts in the left top corner, and clear the right side...

I would have gone with an image first before trying the >, you can make it a transparent png but ie6 won't like it, so I would make 2 one for normal state and one for hover/active...
The Shadow
Forum Members
Forum Members
Posts: 22
Joined: Sun Apr 04, 2010 5:37 pm

Re: Need some help customizing my menu

Post by The Shadow »

owr_web wrote:
But maybe also this works:
>Tuition
Thanks everyone, and especially owr_web!  Your suggestion worked perfectly in all of the browsers that I checked. 

Thanks again everyone!
Post Reply

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