How to Hide menu when active

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
Chris
Forum Members
Forum Members
Posts: 49
Joined: Tue Mar 22, 2005 6:59 pm

How to Hide menu when active

Post by Chris »

Hi all,

I think it's an easy question. How do i hide my complete menu if one of the items is selected?

This is Why. On the left side of the page I have my Main items of the menu (Lets call it menu 1) "{menu template='simple_navigation.tpl' number_of_levels='1'}" On the right side I have the higher 2 levels  (Lets call it menu 2) "{menu template='simple_navigation.tpl' start_level='2'  number_of_levels='2' collapse='0'}".

I Also have a fixed portion which I want to have on the right side of the menu (below the 2 to 3 levels). (Lets call it menu 3) "{menu template='simple_navigation_mod.tpl' start_level='2'  number_of_levels='2' start_page="Fixed_itemd_dont_change_name" collapse='0'}" This one shows the "Contact" and "About info".

The problem is that when I click on an Item in Menu 3 it also aprears in Menu 2 which is logical. So if an item in Menu 3 is selected I need it to disaprear. (Since it is shown in menu 2). I thought I could do this within the template, hence the 'simple_navigation_mod.tpl'.

How can I hide this is a template? It is same like collapsing but then the other way around.

I thought "{if $node->active != true}" whould work but it doesn't....

So Anyone who is more into templates ??????

Thanks in Advance,

Chris
User avatar
kermit
Power Poster
Power Poster
Posts: 693
Joined: Thu Jan 26, 2006 11:46 am

Re: How to Hide menu when active

Post by kermit »

easy way to hide "duplicate" entry in "menu 3".....

wrap "menu 3" around a (uniquely identified) div, if you haven't already done so; then hide its current page using css....

#menu3 li.currentpage {display:none;}

note: if "about" or "contact" have child pages, their respective child pages would also be hidden....


or, easy way to have "about" and "contact" pages ONLY in "menu 3" (and no others).

turn off "show in menu" for "about" and "contact" pages, then use the items parameter (see menumanager help) for menu 3's tag.....

{cms_module module='menumanager' template='simple_navigation_mod.tpl' items='about,contact'}

note: if you have a {sitemap} page and aren't using its showall parameter, you'll need oo specifically add those two pages to it...

{sitemap add_elements='about,contact'}


if you want to remove "menu 3" ENTIRELY if EITHER of its items are selected..

you can use some {smarty} to check the current page_alias and then call "menu 3" only when current page_alias is not "about" or "contact".
Last edited by kermit on Tue Dec 18, 2007 5:24 pm, edited 1 time in total.
eternity (n); 1. infinite time, 2. a seemingly long or endless time, 3. the length of time it takes a frozen pizza to cook when you're starving.
4,930,000,000 (n); 1. a very large number, 2. the approximate world population in 1986 when Microsoft Corp issued its IPO. 3. Microsoft's net profit (USD) for the quarter (3 months) ending 31 March 2007.
CMSMS migration and setup services | Hosting with CMSMS installed and ready to go | PM me for Info
Post Reply

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