Hello,
I’m trying to build a custom CMB2 field that display a “Open Builder” button, just like the one used in the Layout Builder widget.
(I want to provide an additionnal content field on posts, that also uses PageBuilder)
I’m not sure about how to instanciate it : Should I call directly the widget “SiteOrigin_Panels_Widgets_Layout”, or can I call directly the field “SiteOrigin_Widget_Field_Builder” ?
I searched on the forum and didn’t find similar questions. Do you have recommandation about how to do this ?
Many thanks for your plugin !
Hi Alexis,
Those ideally should only be used in a SiteOrgin Widgets Bundle widget as we can’t guarantee they’ll work if used outside of it. Regardless, it’s worth giving them a try but I personally wouldn’t recommend it and instead recommend manually doing it.
All SiteOrigin Page Builder instances use soPanelsSetupBuilderWidget so you can sidestep the builder form by replicating its markup and then triggering that function. To trigger the button mode, you’ll need to set the mode to dialog. For reference, here’s the code for the soPanelsSetupBuilderWidget.
Kind regards,
Alex