Set variable in PHP and output in Perch Block - Perch Blog
Using Perch Blog I want to have a block in which there will be a select drop down. The HTML for this is generated with PHP.
However, I cannot seem to access the variable. I have a perch block in post.html like so:
<perch:block type="select-block" label="Select an option"> <div class="row select-row"> <div class="col-lg-12"> <div class="select-wrap"> <perch:template path="blog/custom/select.html" /> </div> </div> </div> </perch:block>
I set the select_options_html var like so (just after including runtime.php):
PerchSystem::set_vars([ 'select_options_html' => $select_options_html, ]);
And call this variable in my template file (blog/custom/select.html):
<div class="module"> <div class="select-option"> <perch:blog id="select_options_html" /> </div> </div>
Yet this is not getting output. Where am I going wrong with this? Many thanks.
Want to reply to this thread?Login with Perch