Have one menu item always highlighted - 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
tyman00
Power Poster
Power Poster
Posts: 906
Joined: Tue Oct 24, 2006 5:59 pm

Have one menu item always highlighted - SOLVED

Post by tyman00 »

I would like to draw attention to one menu item with Menu Manager. I would like to bold the text or change the background color of the menu item on every page, not just when that page is active.

I got lost trying to understand the operating logic of Menu Manager so I am not sure if it is even possible.

With a slight hope,  I tried using HTML in the menu text for the page. But, as expected it displayed the text/characters instead of interpreting them.
Last edited by tyman00 on Tue Aug 21, 2007 4:03 pm, edited 1 time in total.
If all else fails, use a bigger hammer.
M@rtijn wrote: This is a community. This means that we work together and have the same goal (a beautiful CMS), not that we try to put people down and make their (voluntary) job as difficult as can be.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Have one menu item always highlighted

Post by calguy1000 »

Its possible.

You'll have to create a menu manager template that's a copy of the one you're using now, and modify it.

In the simple navigation templae you'd add something to the top of the big if/elseif expression like:

{if $node->alias == 'blah'}
...
{elseif ...}
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
tyman00
Power Poster
Power Poster
Posts: 906
Joined: Tue Oct 24, 2006 5:59 pm

Re: Have one menu item always highlighted

Post by tyman00 »

That worked perfect, thanks!

I changed the default cssmenu.tpl file (after I made a backup of course  :))

For future readers here is how I did it.

I added the bold red code to the following lines to make the text bold for that menu item.
{if $node->type != 'sectionheader' and $node->type != 'separator'}
href="{$node->url}" {if $node->alias == 'page-alias'}style="font-weight:bold"{/if} {if $node->accesskey != ''}accesskey="{$node->accesskey}" {/if}{if $node->tabindex != ''}tabindex="{$node->tabindex}" {/if}{if $node->titleattribute != ''}title="{$node->titleattribute}"{/if}{if $node->target ne ""} target="{$node->target}"{/if}>{$node->hierarchy}: {$node->menutext}
Of course change the 'page-alias' text to the alias of your own page.
If all else fails, use a bigger hammer.
M@rtijn wrote: This is a community. This means that we work together and have the same goal (a beautiful CMS), not that we try to put people down and make their (voluntary) job as difficult as can be.
Pierre M.

Re: Have one menu item always highlighted - SOLVED

Post by Pierre M. »

Thank you for sharing this.

Pierre M.
tyman00
Power Poster
Power Poster
Posts: 906
Joined: Tue Oct 24, 2006 5:59 pm

Re: Have one menu item always highlighted - SOLVED

Post by tyman00 »

No problem! Thank you to Calguy for the fast and helpful response.

If you want to see it in action here is the link. It is under the Personal menu. Subtle, yet effective.
If all else fails, use a bigger hammer.
M@rtijn wrote: This is a community. This means that we work together and have the same goal (a beautiful CMS), not that we try to put people down and make their (voluntary) job as difficult as can be.
Post Reply

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