[Solved] How to display the parent of current page?

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
atired
Forum Members
Forum Members
Posts: 26
Joined: Mon May 21, 2007 8:37 pm

[Solved] How to display the parent of current page?

Post by atired »

Hi,
I have two menus in my page, just like the 'Top simple navigation + left subnavigation + 1 column'. A header menu and a left submenu.
I need the left submenu to show the second level pages of that section only. To do so, I put in my template {menu template=simple_navigation start_level="2"}.
But I want it to show in which section the user is. It must show the name of the parent of the active page, without a link.
Currently, I made a template for each item of the header menu:
Template 1:

    Services
       {menu template=simple_navigation start_level="2"}

Template 2:

    Clents
       {menu template=simple_navigation start_level="2"}


But I want to have just one template, as everything else in it is the same. How do I do it?
Last edited by atired on Fri Sep 05, 2008 4:31 am, edited 1 time in total.
User avatar
CMSMS-Fan
Forum Members
Forum Members
Posts: 76
Joined: Tue Feb 28, 2006 5:35 pm

Re: How to display the parent of current page?

Post by CMSMS-Fan »

It may be too difficult I have exactly the same issue and have created a total of 26 templates to accomodate - very confusing for my little brain though. ???
Often Ignored but never forgotten
User avatar
CMSMS-Fan
Forum Members
Forum Members
Posts: 76
Joined: Tue Feb 28, 2006 5:35 pm

Re: How to display the parent of current page?

Post by CMSMS-Fan »

Martin,
You are a God......  This is too simple to be true and it works......  Well done I had given up looking at ways to do this and could be incorporated in Hints and Tips as I have no doubt many sites with split menus could use it.
Often Ignored but never forgotten
atired
Forum Members
Forum Members
Posts: 26
Joined: Mon May 21, 2007 8:37 pm

Re: How to display the parent of current page?

Post by atired »

Thank you, Thank you, Thank you. That´s exactly what I needed. This community is the BEST!!
Last edited by atired on Fri Sep 05, 2008 4:31 am, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: [Solved] How to display the parent of current page?

Post by Dr.CSS »

Hmm I just answered this in another thread with much less code, getting the parent, root, and menu text...
blissofbeing

Re: [Solved] How to display the parent of current page?

Post by blissofbeing »

Mark, you must be talking about this post:

http://forum.cmsmadesimple.org/index.ph ... #msg112125

Where you said to use this code:

Code: Select all

{$cgsimple->get_root_alias('','root_alias')}{$cgsimple->get_page_title($root_alias)}
This works great also!

Make sure you install the CGSimpleSmarty module, which is super easy. Thanks.

Update:
3 New solutions can be found here:

http://forum.cmsmadesimple.org/index.ph ... #msg123613
Last edited by blissofbeing on Sat Sep 13, 2008 12:01 am, edited 1 time in total.
Post Reply

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