Hi everyone,
I am struggling with the following:
I made a menu and it almost works.
<ul class="menu">
<?php foreach($pages->visible() as $p): ?>
<li>
<a class="al has-dropdown <?php e($p->isOpen(), ' active') ?>" href="<?php echo $p->url() ?>"><?php echo $p->title()->html() ?></a>
<?php if($p->hasVisibleChildren()): ?>
<ul class="submenu ">
<?php foreach($p->children()->visible() as $p): ?>
<li>
<a href="<?php echo $p->url() ?>" class="al <?php e($p->isOpen(), ' active') ?>"><?php echo $p->title()->html() ?></a>
</li>
<?php endforeach ?>
<div class="cf"></div>
</ul>
<?php endif ?>
</li>
<?php endforeach ?>
</ul>
The problem now is that every menu item a dropdown sign has even when there is no submenu. I know this has to do with the: “has-dropdown” class but can’t get it working. Can anybody help me?
Thanks!