Question about showing 'child' menu on some pages, not others

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"
Locked
greenstylemag

Question about showing 'child' menu on some pages, not others

Post by greenstylemag »

I'm new to CMSMS, but wasn't able to find the answer to this anywhere in the documentation or the forums...

I'm creating a web portal (http://www.greenstylemag.com) that will have a number of different page layers. I'm using the Softened Cells template with a few custom tweaks. The main menu is the one that came with Softened Cells, and the 'child' menu is "list_children" from the user handbook, with a couple of style tweaks.

My problem is this:

I have two menus set up. One is the main menu, across the top of the site just under the header image. I also have a 'child' menu that currently only shows the children of the parent section that you are in. The current hierarchy looks a bit like this:

1. Home
2. LifeStyle
2.1 Interior Design
3. Blog
4. Get Involved
4.1 Charities
5. Store

When you click on, say, "lifestyle", the Interior design link shows up in the child menu on the left, as it should. But then if you click on "interior design", nothing shows up in the child menu (as there are no child pages yet, I'm guessing that if there were, those would show up). But, I want it to always show the child menu of the main parent, and not going deeper into the hierarchy in that menu. So, if you click on "lifestyle", "interior design" shows up, and then if you click on "interior design", "interior design" will still be showing up in the 'child' menu (along with any other children of the parent "lifestyle").

I also want to have it so that if a page doesn't have any child pages (such as the home page), something else (another module) can be placed in the area that the child menu is in. I know that I can do this part of it by setting up a separate template just for the home page that doesn't have that module, but is there any way to do it so that I don't need to work with two separate templates (just to make changing/editing the style/templates easier)?

Thanks in advance for help/ideas/solutions.
Caspar

Re: Question about showing 'child' menu on some pages, not others

Post by Caspar »

Check out the number_of_levels and start_level parameters for your menu tag, it's usually explained in the help for ModuleManager.
Used somehow like:

Code: Select all

{menu template='yourtemplate.tpl' start_level='2' number_of_levels='1'}
Regards,
Caspar
greenstylemag

Re: Question about showing 'child' menu on some pages, not others

Post by greenstylemag »

I tried doing that, but when I insert that code, the menu doesn't show up at all (I tried it a couple different times with different numbers, but nothing showd up). I'm using the Menu Manager module if that's helpful. I also noticed that it's showing the child pages of all of the parent categories, not just the one you've clicked on. I want it to only show the children of the parent category that's been clicked. I'm thinking that maybe the menu code that I'm using isn't suitable. Any more ideas? Thanks!
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Question about showing 'child' menu on some pages, not others

Post by Dr.CSS »

The parameters for the menu/MenuManager or any other modules is in Extensions > Modules click the name of the Module or Help across from it...

To get it to show all the time you may need add collapse='0'  will show items related to the current page selected...

(optional) collapse="1" - Turn on (set to 1) to have the menu hide items not related to the current selected page.

If you look at the default install templates they have one, menu tag, that is like you need...
greenstylemag

Re: Question about showing 'child' menu on some pages, not others

Post by greenstylemag »

Thanks for all the replies. I finally did get it working the way I want (kind of, but I think I actually like it more now). I ended up using the original list_child menu, and then adding the Generic Sub-Menu User Defined Tag. And to solve the problem I was having with nothing showing up if there was no parent or child page to the current page is to put the random quote module underneath the menu module in the same block, so that if there's no menu, just the quote shows up. Thanks for all the input!
Locked

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