Commits

pietschy committed 70867d2

added new class for children that redirect to their first child

Comments (0)

Files changed (1)

elements/navigation_builder/default/nav_item.php

 if ($navItem->isHomePage()) {
     $classNames[] = 'home-page';
 }
+$anchorClassNames = array();
+if ($navItem->hasChildren() && $navItem->pageAttribute('replace_link_with_first_in_nav')) {
+    $anchorClassNames[] = 'redirects-to-first-child';
+}
 ?>
 <li class="<?= join(' ', $classNames)?>">
-    <a href="<?=$navItem->getURL()?>" target="<?=$navItem->getTarget()?>"><?=$navItem->getName()?></a>
+    <a href="<?=$navItem->getURL()?>" class="<?= join(' ', $anchorClassNames)?>" target="<?=$navItem->getTarget()?>"><?=$navItem->getName()?></a>
     <? if ($navItem->hasChildren()) { ?>
     <a href="#" class="flyout-toggle"><span> </span></a>
     <ul class="flyout">