Forum

Thread tagged as: Question

from-path navigation

Hi

I'm running into a few issues with navigation levels in perch.

Navigation structure

2018(folder)
participants(sub folder)
- Competition 1 (page)
- Competition 2 (page)
results(sub folder)
- competition 1 results (page)
- competition 2 results (page)
concerts(sub folder)

On the site I have a 2018 side navigation. In this I want to show everything that is in the parent 2018 folder no matter what folder I'm in. Currently when I'm on the 2018 main folder index page I can see each section which is fine.

<?php 
perch_pages_navigation(array(
'from-path'      => '*',
'levels'         => 1,
'include-parent' => false,
'flat'           => true
));
?>

When I go to for example the participants folder index page the side navigation changes to show only what is in the participants folder, meaning I don't see the links for results, concerts, or 2018. Is there anyway to make this work that all folder levels can be shown from 2018 and the pages of the expanded section I'm currently viewing i.e. Participants? I know you can do a from-path /2018 but the issue is that there will be more years added in future so the from-path can't be a fixed path name.

Participants Template side navigation code

<?php 
perch_pages_navigation(array(
'from-path'      => '*',
'levels'         => 0,
'include-parent' => true,
'flat'           => false,
'only-expand-selected' => false
));
?>

Any help would be much appreciated.

Thanks

Peter Meenagh

Peter Meenagh 0 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Is from-level what you want here?

Ah right so it would be say 'fom-level' => 1 and remove levels altogether?

Drew McLellan

Drew McLellan 2638 points
Perch Support

If that doesn't work, let us know what result you're getting and how it's different from what you expect.

That fixed it Drew thanks.