It is working fine on a previous website, but when I copied same in new install, then it is not accepting this UDT {sidemenu} after force submitting the pages are getting deformed.
can you help me get the error from here or other code to call child pages in sidebar. I am not good with Menu Manager, so any UDT or other solution than Menu Manager will help.
Code: Select all
global $gCms;
$manager =& $gCms->GetHierarchyManager();
$thisPage = $gCms->variables['page_name'];
$currentNode = &$manager->sureGetNodeByAlias($thisPage);
$nodes = $currentNode->getChildren();
if ($currentNode->hasChildren()) {
echo '<h2 class="leftTitle">In this section:</h2><ul>';
foreach ($nodes as $node) {
$content= $node->getContent();
$url = $content->GetURL();
if ($url == "#") { /* section header has no link by default */
$url = "index.php?page=".$content->Alias();
}
echo "<li><a href=\"".$url."\">".$content->MenuText()."</a> </li>";
}
echo "</ul>";
}
else if($currentNode->hasChildren()==false)
{
$nodes = &$currentNode->getParentNode()->getChildren();
echo '<h2 class="leftTitle">In this section:</h2><ul>';
foreach ($nodes as $node) {
$content= $node->getContent();
$url = $content->GetURL();
if ($url == "#") { /* section header has no link by default */
$url = "index.php?page=".$content->Alias();
}
echo "<li><a href=\"".$url."\">".$content->MenuText()."</a> </li>";
}
echo "</ul>";
}