Home>Support>Use Layout Builder Widget in a Custom Widget

Use Layout Builder Widget in a Custom Widget

Dear SiteOrigin Team, hey community,

i’m building a custom widget and tried to use the Form Field “Widget” in it.

–> https://siteorigin.com/docs/widgets-bundle/form-building/form-fields/#heading-widget

It should use the entire form a any Widget.
As i put in the Class Name of the Layout Builder Widget ( SiteOrigin_Panels_Widgets_Layout ) to the piece of code given in the above Link destination, i get following error in the backend of my custom widget:
“SiteOrigin_Panels_Widgets_Layout is not a SiteOrigin Widget”

Can someone help me or have a good advice for me?

Thank you all in advance

Moo

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 7 years, 10 months ago Alex S
    Hi, I Work Here

    Hi Moo,

    I’m unsure why this is happening but I’ll look into it. Regardless, I strongly suggest using the builder form field instead.

  2. 7 years, 10 months ago Dr. Moo

    Hey Alex,

    thank you so much for your response! I gonna try that builder form field!

    Greetings from Germany

  3. 7 years, 10 months ago Dr. Moo

    I’m getting a white screen … can you reproduce that?

  4. 7 years, 10 months ago Alex S
    Hi, I Work Here

    Hi Moo,

    In relation to what? When you set the form field to an editor?

    I suspect you’re experiencing a PHP error and you just can’t see it. Try enabling WP_DEBUG.

  5. 7 years, 10 months ago Dr. Moo

    Hey Alex,
    sorry for less information.

    I placed that in a clean new custom widget php file:

    'some_widget' => array(
        'type' => 'widget',
        'label' => __( 'Button Widget', 'widget-form-fields-text-domain' ),
        'class' => 'SiteOrigin_Widget_Field_Builder',
        'hide' => true
    )

    Setting an other widget class, for example the button class it works fine. Setting the Field Builder class i got following error: “Uncaught InvalidArgumentException: SiteOrigin_Widget_Field_Base::__construct: $field_options must contain a ‘type’ field.”

    Hope that can help you.

  6. 7 years, 10 months ago Alex S
    Hi, I Work Here

    Hi Moo,

    Oh, sorry! SiteOrigin_Widget_Field_Builder is a form field, not a widget. Please change the type to builder and remove the class.

    To clarify, the type is whatever is after SiteOrigin_Widget_Field_.

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.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More