Forum

Thread tagged as: Question, Problem

Exclude parent from navigation

Hello,

On my website I have a page with this structure: https://imgur.com/a/W12zx

On every page I display a navigation, excluding the current page: https://imgur.com/a/NqTMP

For all the subpages of '/verzekeringen' it works, but when I am on a subpage of 'Transportverzekeringen' the parent 'Transportverzekeringen' also gets displayed: https://imgur.com/a/R0ow4

I would like to exclude 'Transportverzekeringen' when on a subpage of said page.

This is my code:

                        <?php
                            perch_pages_navigation(array(
                                'from-path'            => '/verzekeringen',
                                'levels'               => 1,
                                'hide-extensions'      => true,
                                'hide-default-doc'     => true,
                                'flat'                 => false,
                                'template'             => 'verzekering_next.html',
                                'include-parent'       => false,
                                'skip-template'        => false,
                                'siblings'             => false,
                                'only-expand-selected' => false,
                                'add-trailing-slash'   => false,
                                'navgroup'             => false,
                                'include-hidden'       => false,
                            ));
                        ?>
Mike Hendriks

Mike Hendriks 0 points

  • 3 years ago

I think you can add;

'include-parent' => false,

I did, not working. :(

Sorry, I didn't notice you had that in already. I wonder if you can get around this with the from path

'from-path' => '*'

I used this on one of my sites where the nav was on the subpage and I didn't want to display the parent

Thanks for the reply. I have more pages than only this one, so from * path would make it display all pages that I have.