Forum

Thread tagged as: Question, Problem

Include navigation in a template

Hi, I've probably missed something fundamental here, but I want to include the following in a template


<?php perch_pages_navigation(array( 'from-path' => '/about', 'levels' => 1 )); ?>

Am I trying to do something that isn't possible?

Thanks,

Ian

Ian Buchanan

Ian Buchanan 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

You need to do that in the page and then pass it into the template.

    $nav = perch_pages_navigation(array(
        'from-path' => '/about',
        'levels'    => 1
    ), true);

    PerchSystem::set_var('nav', $nav);

then in your template

<perch:content id="nav" encode="false" />

Great, thanks Drew, I'll give it a go.

Ian