Hi,
A problem has arisen with the child items in the navigation menu using the code below.
<nav class="nav">
<ul class="sf-menu" data-type="navbar">
<?php foreach ($nav_menuRecords as $categoryRecord): ?>
<?php if ($categoryRecord['display']==1): ?>
<?php echo $categoryRecord['_listItemStart'] ?>
<?php if ($categoryRecord['_isSelected']): ?>
<a href="<?php echo $categoryRecord['link'] ?>"><?php echo $categoryRecord['name'] ?></a>
<?php else: ?>
<a href="<?php echo $categoryRecord['link'] ?>"><?php echo $categoryRecord['name'] ?></a>
<?php endif; ?>
<?php echo $categoryRecord['_listItemEnd'] ?>
<?php endif; ?>
<?php endforeach; ?>
</ul>
</nav>
The above code produces the following HTML structure:
<nav class="nav">
<ul class="sf-menu" data-type="navbar">
<li><a href="x.php">Home</a></li>
<li><a href="">Festive Menus</a>
<ul>
<li><a href="/download/2016_psb_festive_menu.pdf">Festive menu</a></li>
<li><a href="/download/2016_psb_christmas_lunch.pdf">Christmas lunch</a></li>
</ul>
</li>
<li><a href="#">Menus</a>
<ul>
<li><a href="y.php">Child Menu Item</a></li>
<li><a href="y.php">Child Menu Item</a></li>
<li><a href="y.php">Child Menu Item</a></li>
<li><a href="y.php">Child Menu Item</a></li>
</ul>
</li>
<li><a href="/reservations.php">Reserve a table</a></li>
<li><a href="/contact.php">Contacts</a></li>
</ul>
</nav>
However, I want to hide 'Christmas Menu' in the Festive Menus dropdown list. I do that by unchecking the 'Display' box in the Section Editor (see attached screenshot). When I do that it produces the following HTML structure which alters the original structure because it is removes the closing </ul> & ,/li> tags in this dropdown list and subsumed the items which follow as children and grandchildren (??) in this list. This is a built-in CMSB thing. I need to rectify this. How?
<nav class="nav">
<ul class="sf-menu" data-type="navbar">
<li><a href="/home.php">Home</a></li>
<li><a href="">About</a>
<ul>
<li><a href="/aboutus.php">Our Restaurant</a></li>
<li><a href="/subscribe.php">Newsletter subscription</a></li>
</ul>
</li>
<li><a href="">Festive Menus</a>
<ul>
<li><a href="/download/2016_psb_festive_menu.pdf">Festive menu</a></li>
</ul> } These are stipped out. The effect is that the items below
</li> } become children and grandchildren (??) in this dropdown list.
<li><a href="#">Menus</a>
<ul>
<li><a href="y.php">Child Menu Item</a></li>
<li><a href="y.php">Child Menu Item</a></li>
<li><a href="y.php">Child Menu Item</a></li>
<li><a href="y.php">Child Menu Item</a></li>
</ul>
</li>
<li><a href="/reservations.php">Reserve a table</a></li>
<li><a href="/contact.php">Contacts</a></li>
</ul>
</nav>
Thanks
Terry