Is there a method/function that i could use in a (menu) tamplate to get a node via hierarchy?
for example i'm on page 1.2.3 and i want to get the (parent) node 1.2
my problem is that if i'm on a page i need to get the parent node's alias and i think the best way is through hierarchy.
my menu hierarchy looks like that
1. lang1
1.1 goods
1.1.x
1.2 services
1.2.x
2. lang2
2.1 other goods
2.1.x
2.2 other services
2.2.x
whenever i'm on the x level, i need to know the upper level aliases (goods, services). i have 2 menus (goods, services) for each language and i don't even get to touch the goods or services nodes, i only loop the x ones.
thanks in advance
Andres
getting node with hierarchy in menu template
Re: getting node with hierarchy in menu template
temporarily fixed the problem with UDT that eats node id's for params:
global $gCms;
$manager =& $gCms->GetHierarchyManager();
//$thisPage = $gCms->variables['page_name'];
$current = &$manager->sureGetNodeById((int)$params['id']);
$h = $current->getParent()->getContent();
echo($h->Name());
global $gCms;
$manager =& $gCms->GetHierarchyManager();
//$thisPage = $gCms->variables['page_name'];
$current = &$manager->sureGetNodeById((int)$params['id']);
$h = $current->getParent()->getContent();
echo($h->Name());
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: getting node with hierarchy in menu template
Look at the CGSimpleSmarty module.
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.
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.