Forum
Page Navigation
Can someone see what I am doing wrong;
Navigation template -> item.html
<perch:before>
<ul class="nav sf-menu clearfix">
</perch:before>
<li<perch:if exists="current_page"> class="active"</perch:if><perch:if exists="ancestor_page"> class="sub-menu sub-menu-1"</perch:if>>
<a href="<perch:pages id="pagePath" />"><perch:pages id="pageNavText" />
<perch:if exists="ancestor_page">
<i class="fa fa-angle-down" aria-hidden="true"></i>
</perch:if>
</a>
<perch:if exists="ancestor_page">
<perch:before>
<ul>
</perch:before>
<perch:pages id="subitems" encode="false" />
<perch:after>
</ul>
</perch:after>
<perch:else>
</li>
</perch:if>
<perch:after>
</ul>
</perch:after>
The HTML should look like this;
<ul class="nav sf-menu clearfix">
<li>
<a href="index.html">home</a>
</li>
<li>
<a href="index-1.html">about</a>
</li>
<li>
<a href="index-2.html">hot tours</a>
</li>
<li class="active">
<a href="index-3.html">destinations</a>
</li>
<li class="sub-menu sub-menu-1">
<a href="#">Pages
<i class="fa fa-angle-down" aria-hidden="true"></i>
</a>
<ul>
<li>
<a href="index-4.html">Gallery</a>
</li>
<li>
<a href="index-5.html">Services</a>
</li>
<li>
<a href="404.html">404 page not found</a>
</li>
</ul>
</li>
<li class="sub-menu sub-menu-1">
<a href="#">Blog
<i class="fa fa-angle-down" aria-hidden="true"></i>
</a>
<ul>
<li>
<a href="blog.html">Blog</a>
</li>
<li>
<a href="blog-post.html">Blog Poast</a>
</li>
</ul>
</li>
<li>
<a href="index-6.html">contacts</a>
</li>
</ul>
it actually look like this;
<ul class="nav sf-menu clearfix">
<li class="sub-menu sub-menu-1">
<a href="#">About
<i class="fa fa-angle-down" aria-hidden="true"></i>
</a>
<ul>
</li>
<li class="sub-menu sub-menu-1">
<a href="#">Gallery
<i class="fa fa-angle-down" aria-hidden="true"></i>
</a>
</li>
<li class="active">
<a href="#">Home
</a>
<li class="sub-menu sub-menu-1">
<a href="#">Divers Tales
<i class="fa fa-angle-down" aria-hidden="true"></i>
</a>
</li>
<li class="sub-menu sub-menu-1">
<a href="#">Members Area
<i class="fa fa-angle-down" aria-hidden="true"></i>
</a>
</li>
<li class="sub-menu sub-menu-1">
<a href="#">Diving
<i class="fa fa-angle-down" aria-hidden="true"></i>
</a>
</ul>
</li>
</ul>
I swear I have gone this before but I cannot find the code and now I am going brain dead.
Dennis
I think on line 11 of your template you want
subitems
instead ofancestor_page
.I usually do this with two templates, so I'd be interested if it works.
Simon, That did not work. All the items just appear at the top. How have you done this with templates
I have found out about the template and I have changed them to look like this.
navigation.php
Level1.html
level2.html
But it is treating each item as a sub item.
If I change level1.html line 5 too this. It makes no difference.
We use two html templates for our drop down for product categories. We also use categories instead of perch_pages_navigation
Check this link https://forum.grabaperch.com/forum/07-13-2018-looping-through-all-categories-displaying-all-items-within-each-category
This is the method I use (for Bootstrap).
For Nav
My nav templates are:
level1.html
:level2.html
:Hi All,
Thanks for the help. I manged to made it work with a combination of Simons work and my own pig headedness to get this running.
Thanks again for all you help
Dennis