Page 1 of 1
Have one menu item always highlighted - SOLVED
Posted: Tue Aug 21, 2007 3:24 pm
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.
Re: Have one menu item always highlighted
Posted: Tue Aug 21, 2007 3:30 pm
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 ...}
Re: Have one menu item always highlighted
Posted: Tue Aug 21, 2007 4:03 pm
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.
Re: Have one menu item always highlighted - SOLVED
Posted: Wed Aug 22, 2007 9:46 am
by Pierre M.
Thank you for sharing this.
Pierre M.
Re: Have one menu item always highlighted - SOLVED
Posted: Wed Aug 22, 2007 5:43 pm
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.