Render “builder” Form Field in Template?
Hey,
I’m trying to use the “builder” Form Field Type to let the user use the page builder layout inside a widget. On the backend this works perfectly, but how do I render it in the template?
That’s my form array:
'heading' => array(
'type' => 'text',
'label' => 'Name',
),
'content' => array(
'type' => 'builder',
'label' => 'Akkordion-Inhalt',
),
'already_opened' => array(
'type' => 'checkbox',
'label' => 'Schon geƶffnet?',
'default' => false
),
'last' => array(
'type' => 'checkbox',
'label' => 'Letztes Element?',
'default' => false
)And here’s the (simplified) Template:
<div class="accordion-section <?php if($instance['last']) { echo "last margin-bottom"; }?>">
<div class="accordion-section-header <?php echo $section_header_color;?> <?php if($instance['already_opened']) { echo "active"; }?>">
<h2><?php echo $instance['heading'];?></h2>
<div class="accordion-section-header-arrow"></div>
</div>
<div class="accordion-section-content">
<div class="content-part">
<?php echo $instance['akkordeon_content'];?>
</div>
</div>
</div>But
$instance['akkordeon_content'];is an array containing all the widgets etc. used in the backend … how do I render that?
This is our free support forum. Replies can take several days.
Need fast email support? Get SiteOrigin Premium
Replies
3Hi Andreas,
You’ll need to use siteorigin_panels_render() to render it. For more information please refer to siteorigin_panels_render() and the layout slider for an example.
Awesome, thanks a lot!
Hi Andreas,
Happy to help mate. :)
Replies on this thread are closed.
Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.