Forum

Thread tagged as: Question

Passing perch_pages_navigation result in to content region (including template)

Is there anyway of passing the results (including template) of a perch_pages_navigation call through to a content region? Something like this…

$office_space_links = perch_pages_navigation(array(
        'from-path' => '/office-space',
        'template' => 'item.html',
       'levels'    => 1
), true);

PerchSystem::set_var('office_space_link',$office_space_links);

and then in content region <perch:content id=“office_space_link”>

dhmax88 [10:35 AM] (will post to support forum too)

… can’t get it to output HTML, instead getting this…

<ul class="nav nav--dropdown-list nav--stacked">

        <li class="nav__item ">
            <a href="/the-foundry">The Foundry</a>
        </li>

   </ul>
David Maxwell-Wood

David Maxwell-Wood 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

What's wrong with what you're getting?

ah sorry – i'm getting this output when including <perch:content id="office_space_link"> in my content region ...(the forum converted the encoded html)


&lt;ul class="nav nav--dropdown-list nav--stacked"&gt; &lt;li class="nav__item "&gt; &lt;a href="/the-foundry"&gt;The Foundry&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;

So the result is being outputting to my page as a string by the looks of things.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Add encode="false" to your template tag.

Har diggidy! I was so close...

Thank you Drew.