We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum
How do I pass a variable from a Template to a Layout and back?
I want to pass a filepath from a Template (which as I understand it, does not accept PHP) to a Layout so that I can process that file with ImageMagick and then send the new filepath back to my template. How do I do this?
This is what I tried:
publication.html (the Template)
<perch:layout path="pub.img" file='<perch:content id="PubDownloadLink" type="file" label="Upload Publication PDF File" />' /> <img src='<perch:content id="NewImg" />' />
pub.img.php (the Layout)
$pdf_file = perch_layout_var('file'); // process file $new_file = '../img/' . $processed_file . time(); PerchSystem::set_var('NewImg', "$new_file");
Want to reply to this thread?Login with Perch