Forum

Thread tagged as: Question, Problem, Meta

Rob Willox said:

That works perfectly, thanks Drew. Looking at the output from showall can see now these id's but as new to Perch didn't realise how they could be used but learning every day!

Thanks again for your help and patience.

Do you have the final code that you got working?

Hi Andrew

Was using Foundation5 as framework at that time and it has been updated to Foundation6 so the code might have changed for the topnav. Hope it helps:-

<nav class="topnav" role="navigation">
      <!-- Top Nav Section -->
      <?php perch_pages_navigation(array(
      'levels'    => 0,
      'template'  => array('nav.html', 'nav-d.html'),
      ));
      ?>
</nav>


nav.html

<perch:before>
   <ul class="button-group" role="navigation">
</perch:before>
    <li>
        <perch:if exists="subitems">
            <a href="<perch:pages id="pagePath" />" data-dropdown="hover<perch:pages id="pageID" />" data-options="is_hover:true; hover_timeout:500" class="button">
        <perch:else />
            <a href="<perch:pages id="pagePath" />" class="button">         
        </perch:if> 
        <perch:pages id="pageNavText" /></a>
        <perch:pages id="subitems" encode="false" />
    </li>
<perch:after>
    </ul>
</perch:after>

nav-d.html

<perch:before>
    <ul id="hover<perch:pages id="pageParentID" />" class="f-dropdown mega" data-dropdown-content>
</perch:before>
    <li>
        <a href="<perch:pages id="pagePath" />"><perch:pages id="pageNavText" /></a>
        <perch:pages id="subitems" encode="false" />
    </li>
<perch:after>
    </ul>
</perch:after>

I'm using 6.2 but it is a good starting point, thanks

Hi Andrew,

were you able to get this working for Foundation 6? Please could you post your code?