Notice: This thread is over two years old; the information may be outdated. Please consider creating a new thread if you require free support. If you have an active SiteOrigin Premium license, you can email our premium support desk at [email protected].
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?
Hi 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. :)