I want to show list of all current section pages including parent page and child pages in all that section parent and child pages.
I am using below code, but it is working on parent page only. When I open any child page that list not coming, because of there is no child pages in sub pages.
global $gCms;
$manager =& $gCms->GetHierarchyManager();
$thisPage = $gCms->variables['page_name'];
$currentNode = &$manager->sureGetNodeByAlias($thisPage);
$nodes = $currentNode->getChildren();
if ($currentNode->hasChildren()) {
echo '<ul class="subMenu">';
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>";
}
How to print one page section in website?
-
- New Member
- Posts: 4
- Joined: Sun Jan 23, 2011 3:03 pm
Re: How to print one page section in website?
Try {menu start_level='2'} and it will give a link list of all child pages of current page, if you want the parent page menu text above it you will need to install CGSimplesmarty module and read it's help...