[solved] How to make "get_root_page_alias" printing the "Title" of the root page
Posted: Sat Nov 15, 2008 8:22 pm
Dear all,
I want to print the menu text of the parent of the current site. I found the tag "get_root_page_alias"
It works fine. However, I do not want it to print the root-page-alias but rather the text I entered as page title.
Since I'm not familiar with PHP my try of changing line 17 into
only got me an error. 
What else should I try?
Thanks, nilson
I want to print the menu text of the parent of the current site. I found the tag "get_root_page_alias"
Code: Select all
global $gCms;
global $smarty;
$manager =& $gCms->GetHierarchyManager();
$var = 'root_page_alias';
if( isset($params['assign']) && $params['assign'] != '' )
{
$var = $params['assign'];
}
$result = "NO RESULT";
$thisPage = $gCms->variables['content_id'];
$currentNode = &$manager->sureGetNodeById($thisPage);
while( isset($currentNode) && $currentNode->getLevel() >= 0 )
{
$currentContent =& $currentNode->getContent();
$result = $currentContent->Alias();
$currentNode =& $currentNode->getParentNode();
}
$smarty->assign($var,$result);
Since I'm not familiar with PHP my try of changing line 17
Code: Select all
$result = $currentContent->Alias();
Code: Select all
$result = $currentContent->Title();

What else should I try?
Thanks, nilson