Forum

Thread tagged as: Question, Problem

Passing A Variable Into Template Creates Blank Content Field

I'm passing a variable into a template:

PerchSystem::set_var('dataDestination', 'gen');

perch_content_custom('Dental Fees', array(
  'template' => 'fees.html'
));

Then outputting this like so:

<h3 data-magellan-destination="<perch:content id="dataDestination" />">
  <perch:content id="treatmentsHeading" type="text" label="Fees Name" />
</h3>

However this creates a blank edit field in the admin. Any ideas?

Creative Monster

Creative Monster 0 points

  • 6 years ago
Simon Clay

Simon Clay 127 points

Try adding type="hidden"

<perch:content id="dataDestination" type="hidden" />

That should do it.

I actually knew that! Thanks for the prompt Simon.