Forum

Thread tagged as: Question

Can't seem to get from-path to work in perch_pages_navigation

Hi

I must be having a blonde moment but for the life of me I cannot get from-path to work when using perch_pages_navigation(). Here's my code...

                        perch_pages_navigation(array(
                            'from-path' => '/varieties',
                            'levels'=>1,
                            'hide-extensions' => true,
                        ));

and all it outputs is the root level menu. If i change 'levels' => 2 I do get the root menu plus the /varieties menu too. So Perch knows it's there.

I've doubled and doubled checked and can't see why it's not showing me just the /varieties menu.

Many thanks for any help.

Perch: 3.0.10, PHP: 7.0.22, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: b5c5906d452ec590732a93b051f3827e02749b83 $, with PDO
Server OS: Linux, cgi-fcgi
Installed apps: content (3.0.10), assets (3.0.10), categories (3.0.10), perch_blog (5.6.1), perch_forms (1.9), chirp_seo (1.1)
App runtimes: <?php $apps_list = [ 'perch_blog', 'perch_forms', 'chirp_seo' ];
PERCH_LOGINPATH: /cms
PERCH_PATH: /home/plant/U0MA6EL3/htdocs-asparagus/cms
PERCH_CORE: /home/plant/U0MA6EL3/htdocs-asparagus/cms/core
PERCH_RESFILEPATH: /home/plant/U0MA6EL3/htdocs-asparagus/cms/resources
Image manipulation: GD Imagick
PHP limits: Max upload 128M, Max POST 128M, Memory: 256M, Total max file upload: 128M
F1: 3b606135b33e6a102526838f4152a807
Resource folder writeable: Yes
HTTP_HOST: asparagus.globalplantgenetics.com
DOCUMENT_ROOT: /home/plant/U0MA6EL3/htdocs-asparagus/
REQUEST_URI: /cms/core/settings/diagnostics/
SCRIPT_NAME: /cms/core/settings/diagnostics/index.php
Glen Piggott

Glen Piggott 0 points

  • 3 years ago
Hussein Al Hammad

Hussein Al Hammad 105 points
Registered Developer

Hello Glen,

Is /varieties a sub-page?

If it is a sub-page, you probably need to use 'from-path' => '/parent-page/varieties'.

Hi Hussien

Many thanks for your help.

Unfortunately not, /varieties is a root directory

Glen

Hussein Al Hammad

Hussein Al Hammad 105 points
Registered Developer

While I don't think you normally need to do this, but have you tried using 'from-level' => 2?

perch_pages_navigation(array(
'from-path' => '/varieties',
'from-level' => 2,
'levels'=>1,
'hide-extensions' => true,
));

Hi Hussein

Thanks for your help.

Unfortunately, it's still displaying the root level menu.

Glen

Solved

I had moved and renamed the page - so had a look in the database and the pageSortPath had not updated.

Manually amended the database and hey presto!