Top level page shown as 'ancestor' if in navigation group

  • Hiya,

    I'm using Perch Runway v. 3.1.5 (latest).

    If I hide a page from the main navigation but add it to a navgroup called 'secondary', if it's not the currently active page, it shows as an ancestor.

    The debug output is:

    I display the secondary nav using:

    1. perch_pages_navigation([
    2. 'template' => ['main-nav.html'],
    3. 'navgroup' => 'secondary'
    4. ]);

    Any ideas why it might be doing this?

  • drewm

    Approved the thread.
  • Can anyone in support please confirm if this is expected behaviour? Both pages are sitting at the top level - the pageDepth being '1', but still showing as ancestor. The output from perch showall can be seen here.


    This is my navigation template:

    1. <perch:before><ul class="ul1"></perch:before>
    2. <li class="li1<perch:if exists="current_page"> active</perch:if>">
    3. <a href="<perch:pages id="pagePath" />" class="a1"><span><perch:pages id="pageNavText" /></span></a>
    4. </li>
    5. <perch:after></ul></perch:after>
  • If I show the pages in the main navigation, it's fine, everything works as expected - active pages show as active, ancestor pages show as ancestors.

    If I check the checkbox 'Hide from main navigation' and add to a nav group (mine is named 'secondary navigation'), active pages show as active, and non-active pages show as ancestors, so I end up with the below (unwanted active states on non-active pages)..


    This happens even if I delete the pages, create new pages - the result is consistent.

  • Yes, that's what I'm saying :)

    This was my initial structure for the nav group:


    I did what you suggested earlier (earlier I did it on the items in the main navigation structure) and re-ordered and saved and now it works as expected.

    Must have been something wrong in the data as you suggested earlier...

    Thanks Drew.