Thread tagged as: Question

Pass html into layout variable

In the page I have

perch_layout('home.body', array(
                'col1'=> perch_content('Column 1',true)

In the template for text block I have

<perch:content id="text" type="textarea" label="Text" markdown="true" editor="simplemde" imagewidth="640" imageheight="480" encode="false"/>

And in the layout file I have

<?php perch_layout_var('col1'); ?>

In the output I have html tags incorrectly showing up on the page.

Fred Stidston

Fred Stidston 0 points

  • 3 years ago
Hussein Al Hammad

Hussein Al Hammad 105 points
Registered Developer

Hello Fred,

I think values of layout variables are HTML-encoded by default, but this should do the trick:

$col = perch_layout_var('col1', true);
echo $col;