[solved] menu manager child menu only on parent page?

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
ladyr0gue
Forum Members
Forum Members
Posts: 91
Joined: Fri Feb 17, 2012 4:25 pm

[solved] menu manager child menu only on parent page?

Post by ladyr0gue »

I've done this before successfully but can't figure out what I'm doing wrong this time!

I have three top level pages one of which is called Services appearing in the top menu

Code: Select all

{menu number_of_levels="1"}
I then have a vertical menu in which I list children of Services

Code: Select all

{menu start_level="2" number_of_levels="2" }
My problem is that the second menu only appears on the parent page, Services and on the child page, but not on the other top level pages.
Where have I gone wrong?
Last edited by ladyr0gue on Fri Apr 13, 2012 8:07 pm, edited 5 times in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: menu manager child menu only shows on parent page?

Post by Dr.CSS »

The start_level='2' is for doing exactly what it is doing, showing the second level of menu items for the active parent page in the top menu, if you want all children of all pages you will need to use a different parameter, not that I can think of one...

{menu childrenof='first top level menu item name/alias'}
{menu childrenof='second top level menu item name/alias'}
{menu childrenof='third top level menu item name/alias'}
Last edited by Dr.CSS on Fri Apr 13, 2012 7:38 pm, edited 1 time in total.
Reason: Sorry, I didn't look up the correct syntax...
ladyr0gue
Forum Members
Forum Members
Posts: 91
Joined: Fri Feb 17, 2012 4:25 pm

Re: menu manager child menu only shows on parent page?

Post by ladyr0gue »

Thanks for your reply :) still haven't figured this out though... I am sure I had this working without doing anything complicated when I was working on this before (before I accidentally updated the database)

I did try {menu children_of='services'} just in case ;) but got Warning: Parameter children_of is not known by module MenuManager dropped in C:\xampp\htdocs\cmsms\lib\misc.functions.php on line 1590. Worth a try I suppose...
ladyr0gue
Forum Members
Forum Members
Posts: 91
Joined: Fri Feb 17, 2012 4:25 pm

Re: menu manager child menu only shows on parent page?

Post by ladyr0gue »

ah. getting there! think I have it. where the layout is

1.Home
2.Services
2.1. Service1
2.2. Service2
3.Contact

I have made the sub-menu

Code: Select all

{menu number_of_levels="3" excludeprefix="home,contact"}
which shows
Services
Service1
Service2

in the menu. now to figure out how to hide the top-level Services in the sub-menu and we shall be all good :)
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: menu manager child menu only shows on parent page?

Post by calguy1000 »

Code: Select all

{menu childrenof='services'} 
should always produce a menu with all of the children of 'services'.
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.
ladyr0gue
Forum Members
Forum Members
Posts: 91
Joined: Fri Feb 17, 2012 4:25 pm

Re: menu manager child menu only shows on parent page?

Post by ladyr0gue »

ah there you go, it worked that time, less the underscore, thank you very much :)
ladyr0gue
Forum Members
Forum Members
Posts: 91
Joined: Fri Feb 17, 2012 4:25 pm

Re: eek but it mucks up my css help learner here!

Post by ladyr0gue »

Oh gawd there's one thing. When I use my original menu for this menu of services' children

Code: Select all

{menu number_of_levels="3" excludeprefix="home,contact"}
it sits nicely, one one top of the other and is styled using this stylesheet

Code: Select all

@charset "utf-8";
/* CSS Document */

#navcontainer { width:200 px; float: left; margin: 0 0 0 40px; padding: 0 0 50px 0; display: inline;}
#navcontainer ul {margin: 0 0; padding: 0; list-style-type: none;float: left;}
#navcontainer ul li a {display: block;padding: 8px 31px 8px 18px;width: 151px;background-color: #479C00; font-size: 14px; border-bottom: 1px solid #eee; }
#navcontainer a:link, #navcontainer a:visited {color: #D4E999;text-decoration: none;}
#navcontainer a:hover {background-color: #666;color: #fff;}
#navcontainer li{
	float:left;
	margin: 0;
	position:relative;
}

#navcontainer ul ul {
position: absolute;
top: 100%;
left: 5%;
width: 100%;
}

#navcontainer ul li {position: relative;}

#navcontainer ul ul ul{
position: absolute;
top: 100%;
left: 5%;
width: 100%;
}
#navcontainer ul ul ul li a { background-color:#9CC779;}


#navcontainer ul ul ul li a:link, #navcontainer ul ul ul li a:visited {color: #E9F0D5;text-decoration: none;}
#navcontainer ul ul ul,
#navcontainer ul ul li:hover ul ul
{display: none;}

#navcontainer ul ul li:hover ul,
#navcontainer ul ul ul li:hover ul
{display: block; position: relative; }
but when I use the rather neater solution

Code: Select all

{menu childrenof='services'} 
which of course is an improvement as it doesn't try to add new top level pages or their children to the menu, it rather confuses my css and treats the children as top level pages, which appear side by side and won't float left no matter what I do. I have been trying to amend it for a couple of hours now and can only hope that somebody clever would be kind enough to look at it for me! Please don't laugh at me I am a learner :) xx

* I'm still trying to figure the darned thing out in dreamweaver , I know this isn't a cmsms prob really but a my messy css problem but would really appreciate some pointers :-[
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: menu manager child menu only on parent page? & css probl

Post by Dr.CSS »

That is because you are asking for just the children, if you want Services and it children, maybe...

(optional) start_element="1.2" - Starts the menu displaying at the given start_element and showing that element and it's children only. Takes a hierarchy position (e.g. 5.1.2).

Read the Help of menu manager to find more exciting parameters you can use...
ladyr0gue
Forum Members
Forum Members
Posts: 91
Joined: Fri Feb 17, 2012 4:25 pm

Re: menu manager child menu only on parent page? & css probl

Post by ladyr0gue »

Thanks again for your quick reply - really sorry to be still bugging you but I'm still confused, Services is my third top level page - when I try

Code: Select all

{menu start_element="3.1" }
the menu has disappeared...[/size]

Yay got it...

Code: Select all

{menu start_page="services" }
is what I need. found in help. *hangs head in shame.

I think I love you.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: [solved] menu manager child menu only on parent page?

Post by Dr.CSS »

It would/should have been {menu start_element="3"}...

Glad you found one that works...
ladyr0gue
Forum Members
Forum Members
Posts: 91
Joined: Fri Feb 17, 2012 4:25 pm

Re: [solved] menu manager child menu only on parent page?

Post by ladyr0gue »

Ah yes of course - I think I will stick with start_page for now just in case for some reason the top level page order changes in the future What I was actually trying to go for with

Code: Select all

 {menu start_element="3.1" }
was Services in the top menu and just its children in the side menu... but it's not a biggie :)
Locked

Return to “CMSMS Core”