I have the following Menu structure:
Genre - Fiction - Autobiography - Sci Fi - Other [class="hide"]
The menu created is then /genre/fiction/, /genre/other/. I am trying to not display the /other within the list of menu items which I can easily do by using JavaScript to hide the parent list item. But this is still visible to the crawlers which I am trying to avoid. I could put it under an unpublished/hidden menu but that would mean i loose the top level 'genre' since the /other will become top level since Other won't have any parent.
So the only method I can imagine is to create a mod_menu override (default_url.php) and check for a class set in the backend and if the class is set for any menu item, do not display it.
Where would the if/else condition go in the following code for it to not appear or at the very least; for there to be no link even if the text is displayed? I tried putting it in line 4 but all the links simply turned into a link to the homepage.
switch ($item->browserNav) :
default:
case 0:
?><a <?php echo $class; ?>href="<?php echo $flink; ?>" <?php echo $title; ?>><?php echo $linktype; ?></a><?php
break;
case 1:
// _blank
?><a <?php echo $class; ?>href="<?php echo $flink; ?>" target="_blank" <?php echo $title; ?>><?php echo $linktype; ?></a><?php
break;
case 2:
// window.open
$options = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,'.$params->get('window_open');
?><a <?php echo $class; ?>href="<?php echo $flink; ?>" onclick="window.open(this.href,'targetWindow','<?php echo $options;?>');return false;" <?php echo $title; ?>><?php echo $linktype; ?></a><?php
break;
endswitch;