[solved]content navigation--need to display ORIGINAL parent item at all times

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
streever

[solved]content navigation--need to display ORIGINAL parent item at all times

Post by streever »

Hi all,

my site is organized into sections, and each section has a sub-nav.

See:
http://www.whps.org/cms/index.php?page=primary-offices

Now, what I want is for the FIRST large item to be the PARENT section. In this case OFFICES. I want it to stay as Offices as the user navigates through the sub-items.

I want the menu to always display the 2nd level of navigation (the sub-items) and the parent at the top, as the big title. I want the THIRD level to display beneath it's parent.

Now, I'm very proficient in CSS. I will be hiding/showing the third level of nav in the CSS. That's no problem.  The problem is the TOP most--the title--can anyone help me in displaying that? What is the template call to always display the FIRST parent?

P.S.

I am familiar with the UDT that calguy wrote, but I don't know how to use it.... maybe that would help me? Link: http://forum.cmsmadesimple.org/index.ph ... 405.0.html
Last edited by streever on Thu Sep 06, 2007 5:48 pm, edited 1 time in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: content navigation--need to display ORIGINAL parent item at all times

Post by calguy1000 »

it'd be something like this, I think:
{get_root_alias alias=$page_alias assign='parent'}{menu start_page=$parent}
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.
streever

Re: content navigation--need to display ORIGINAL parent item at all times

Post by streever »

So I can just drop that info in my code?

I also want the GRANDPARENT page to have a unique class--like "pagetitle"--so I am guessing that would have to go in the MenuManager but don't know how to do it.

The best solution for me would be if I had my template:

YOUR SNIPPET
{menu}


This is ideally how I want my template to look-iis that possible?

Thanks so much--
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: content navigation--need to display ORIGINAL parent item at all times

Post by calguy1000 »

Yes, you can drop that into your code

the first thing to do is to use this code, and the differrent parameters of the menu manager template to make sure that the output contains information for the correct nodes.

Then you can worry about editing the menumanager template if needed to adjust the classes, and styles, etc.
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.
streever

Re: content navigation--need to display ORIGINAL parent item at all times

Post by streever »

Hey Calguy,

OK, I'm going to give it a try! I am worried it won't work because I don't know how to pull out the START element in the Menu Template--do you know what I mean? But i am going to be brave and try it.

Thank you!
streever

Re: content navigation--need to display ORIGINAL parent item at all times

Post by streever »

OK, this DOES work!

But I don't know how to style the titles.

Does anyone have a suggestion for how to call them out in the template, the menu manager template? Like, "IF X THEN Y" type of stuff.... I'd like to just assign a class/id to them. The problem is, that I don't know how to do this in the menu manager templates....
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: content navigation--need to display ORIGINAL parent item at all times

Post by calguy1000 »

styling is not my forte :)
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.
streever

Re: content navigation--need to display ORIGINAL parent item at all times

Post by streever »

do you know how to call out that one element though?

so say,

IF PARENTID THEN
ELSEIF

do you know what I mean? ordinarily I'd rely on "menuparent" but that will be whatever button they click next--one of the sub-nav items--because this menu has 3 levels! so I can't use the standard menuparent because several li tags will be menuparents. i need to address "grandparent"....
streever

Re: content navigation--need to display ORIGINAL parent item at all times

Post by streever »

{if $node->parentID == true}alias}" class="menuGrandParent"><a class="menuGrandParent"

this is what I tried, but it didn't work. I'm not sure what to put in place of parentID--the user defined tag is below. That shows how CMSMS knows to put in the grandparent, so to speak.

Code: Select all

/* Get the alias of the top level parent 
    Takes a page alias as input
    outputs a page alias, or an empty string if the alias input is a top level
*/

if( !isset($params['alias']) ) return;

global $gCms;
$contentops =& $gCms->GetContentOperations();

$alias = '';
$id = $contentops->GetPageIDFromAlias( $params['alias'] );
while( $id != -1 )
  {
     $content =& $contentops->LoadContentFromId( $id );
     if( is_object( $content ) ) {
        $alias = $content->Alias();
        $id = $content->ParentId();
     }
  }

if( isset($params['assign']) )
{
  $smarty =& $gCms->GetSmarty();
  $smarty->assign( $params['assign'], $alias );
  return;
}
else 
{
  return $alias;
}
Last edited by streever on Thu Sep 06, 2007 4:46 pm, edited 1 time in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: content navigation--need to display ORIGINAL parent item at all times

Post by calguy1000 »

try {if $node->index == 0} in a menu manager template.
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.
streever

Re: content navigation--need to display ORIGINAL parent item at all times

Post by streever »

YOU MAKE IT LOOK SO EASY!!! That is exactly what I needed.

merci beaucoup, gracious, domo arigato, merci mille fois, etc etc.... you are a life saver yet again.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: content navigation--need to display ORIGINAL parent item at all times

Post by calguy1000 »

You mean it's not easy?  :)
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.
streever

Re: [solved]content navigation--need to display ORIGINAL parent item at all times

Post by streever »

OK, so it is, but in my caffeine addled, stress-induced mind it becomes something big and difficult :D
Locked

Return to “CMSMS Core”