Forum

Thread tagged as: Question, Runway

Dropdown displaying parent page as first link

Hello! We want to create a dropdown. We have a parent page called "Fireplaces". When the user hovers over this top level link, we want the dropdown to display all of our products. This currently works, but inside the dropdown, it is also including the parent page "Fireplaces" right at the top. How can we remove this? Here is the code we have to pull in the navigation data:

<?php perch_pages_navigation(array(
    'template' => 'main_navigation.html',
    'include-parent' => false,
)); ?>

Inside the main_navigation.html template, we have this:

<li class="main-nav-top">
    <a href="<perch:pages id="pagePath" />"><perch:pages id="pageNavText" /><perch:if exists="subitems"> <i class="icon-down-dir"></i></a>
        <div class="dropdown">
            <ul>
                <li><a href="<perch:pages id="pagePath" />"><perch:pages id="pageNavText" /></a></li><perch:pages id="subitems" encode="false" />
            </ul>
        </div>
    <perch:else /></a></perch:if>
</li>

We've included the 'include-parent' => false but it still shows it for some reason.

Thanks!

brian bower

brian bower 0 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Change this:

<div class="dropdown">
    <ul>
        <li><a href="<perch:pages id="pagePath" />"><perch:pages id="pageNavText" /></a></li>
        <perch:pages id="subitems" encode="false" />
    </ul>
</div>

to simply this:

<div class="dropdown">
    <ul>
        <perch:pages id="subitems" encode="false" />
    </ul>
</div>

Great, this worked. Thank you!