Firstly, really liking MODx, fantastic CMS, will definitely be using this more in the future!
However, I’ve come across a problem. I’m trying to tweak the ListMenuX snippet so that it doesn’t show pages that are set not to show up in the menu (with the "Show in menu" check box). Those of you who are familiar with this snippet may recognise this bit of code:
// If child is current document, add activeLink class
if ($child['id']==$modx->documentIdentifier)
{
$menu .= "<li$sLiClass><a$sActiveLinkClass href='[~".$child['id']."~]' title='".$child['description']."'>".$child['pagetitle']."</a>";
}
else
{
$menu .= "<li$sLiClass><a href='[~".$child['id']."~]' title='".$child['description']."'>".$child['pagetitle']."</a>";
}
I’ve added in an extra condition on the else clause:
else if ($child['hidemenu']==0)
This, from what I’ve read, should make sure that only pages that are set to be shown in the menu actually appear in the menu. So far, this hasn’t been working. I even put a little debug line in there so that it printed out in the link what the child’s hidemenu value was, but this came up blank. Am I doing something wrong here? Any helpful insights would be very much appreciated! Just for reference, below is the code I’ve got at the moment:
// If child is current document, add activeLink class
if ($child['id']==$modx->documentIdentifier)
{
$menu .= "<li$sLiClass><a$sActiveLinkClass href='[~".$child['id']."~]' title='".$child['description']."'>".$child['pagetitle']."</a>";
}
// If child IS to be shown in menu
else if ($child['hidemenu']==0)
{
$menu .= "<li$sLiClass><a href='[~".$child['id']."~]' title='".$child['description']."'>".$child['pagetitle']." - ".$child['hidemenu']."</a>";
}