// ------------------------ // Snippet: ListGlobal // ------------------------ // Version: 0.6e // Date: 2005.07.01 // [email protected] // // Snippet for listing global list of links or sections // (Published pages who's parent is root). Highlight ability // for current section. // $node [ int ] // Id of what you want to consider the "root" of the site or section. // For instance, if you branch off several sections from the 0 root level // based on languages, you might want to set the language home page as // the root. Otherwise it will default to 0- which is the site root. It // will also default to 0 when 0 is the literal root. Settable in snippet // call with $LGlob_node: // [[ListGlobal?LGlob_node=7]] $node = 0; // STYLES // .LGlob_list ul element of list // .LGlob_active li of section you are in // ----------------------- // END CONFIG // ----------------------- // Override default node with snippet call if necessary $node = (isset($LGlob_node))? $LGlob_node : $node; // Determine correct node to consider parent $tempPageInfo = $etomite->getPageInfo($etomite->documentIdentifier,0,'parent'); $thisParent = $tempPageInfo['parent']; // Change root node if necessary if ($node && !$thisParent){ $node = 0; } $globalKids = $etomite->getActiveChildren($node); $sectionId = $etomite->documentIdentifier; while ( ($pageInfo = $etomite->getPageInfo($sectionId,0,'parent')) && ($pageInfo['parent'] != $node ) ) { $sectionId = $pageInfo['parent']; } $output = '<ul class="LGlob_list">'; $globalCount = 0; foreach ($globalKids as $kid){ $output .= '<li'; $output .= ($kid['id']==$sectionId)? ' class="LGlob_active"' : '' ; $output .= '><a href="[~'.$kid['id'].'~]" '; $output .= 'title="'.$kid['pagetitle'].'">'; $output .= $kid['pagetitle'].'</a></li>'; $globalCount++; } $output .= '</ul>'; return $output;
while ( ($pageInfo = $etomite->getPageInfo($sectionId,0,'parent,hidemenu')) && ($pageInfo['parent'] != $node ) && ($pageInfo['hidemenu'] == '0')) {echo "<pre>"; print_r($pageInfo); echo "</pre>";
getActiveChildren($id=0, $sort='menuindex', $dir='ASC', $fields='id, pagetitle, description, parent, alias, menutitle')
getActiveChildren($node, , , 'id, pagetitle, description, parent, alias, menutitle, hidemenu')
foreach ($globalKids as $kid){if($kid['hidemenu'] == 0) {
$output .= '<li';
$output .= ($kid['id']==$sectionId)? ' class="LGlob_active"' : '' ;
$output .= '><a href="[~'.$kid['id'].'~]" ';
$output .= 'title="'.$kid['pagetitle'].'">';
$output .= $kid['pagetitle'].'</a></li>';
$globalCount++;
}
[[ListMenuX?id=0&depth=2&divId=my-menu&activeLinkClass=selected]]