Page 1 of 1

Include parent page title in submenu heading

Posted: Mon Mar 30, 2009 11:11 am
by elliot
Hello

Ive got a horizontal top menu for my level 1 links and a vertical submenu in the sidebar for the children of the L1 links. In my sidebar I would like a heading above the menu so that if for instance I was in the 'About Us' section the vertical sub menu in the sidebar would have a heading saying 'About Us Menu'.

Ive got the heading to appear in the sidebar when there are children to display - but how do I get the name of the parent page?

Does this make any sense at all?

Please help if it does

Re: Include parent page title in submenu heading

Posted: Mon Mar 30, 2009 11:53 am
by RonnyK
CGSimpleSmarty has some parameters that can be called/used. IIRC is the get_parent_alias or get_page_title inside.

You could check this module to see, if that works for you.

Ronny

Re: Include parent page title in submenu heading

Posted: Mon Mar 30, 2009 12:45 pm
by elliot
I love it round here, thanks RonnyK.

Installed CGSimpleSmarty and included this in sub nav tpl:

{$cgsimple->get_page_title()} Menu ››

Result: About Us Menu ››

ta daa!!!

Re: [Solved] Include parent page title in submenu heading

Posted: Mon Mar 30, 2009 1:05 pm
by elliot
Actually, it would be better if you could get the root page title, you can get root page alias but not title??

E

Re: [Solved] Include parent page title in submenu heading

Posted: Mon Mar 30, 2009 1:07 pm
by RonnyK
Elliot,

IIRC is it possible in two-steps.... Check the CGSimpleSmartys help for the examples.

You can FIRST, get the root_page_alias, and assign that to a variable, using the parameter in the example,

and SECOND, get the name of the page, for the page, with the variable you just set.

Ronny

Re: [Solved] Include parent page title in submenu heading

Posted: Mon Mar 30, 2009 1:12 pm
by elliot
Ronny, thanks - we are approaching the outer limits of my coding abilities, but I will give this a shot a bit later.

E

Re: Include parent page title in submenu heading

Posted: Tue Mar 31, 2009 8:59 am
by elliot
Hello again, can anybody help me out with the code for this, turned out to be a bit beyond me Im afraid.

Using root page alias is ok, but it has a hyphen so the result is: about-us menu, what I could do with is the root page title but I cant figure out how to do it with the varaible as suggested above.

Re: [Solved] Include parent page title in submenu heading

Posted: Tue Apr 07, 2009 11:34 am
by elliot
RonnyK wrote: Elliot,

IIRC is it possible in two-steps.... Check the CGSimpleSmartys help for the examples.

You can FIRST, get the root_page_alias, and assign that to a variable, using the parameter in the example,

and SECOND, get the name of the page, for the page, with the variable you just set.

Ronny
Can anyone help me out with this bit of code, its beaten me i'm afraid