Home>Support>Widget needs Two color selections in the form widget

Widget needs Two color selections in the form widget

Hi,

I am trying to make a widget where the user has the choice of chosing between two colors to apply to some text/and background on the front end. I am meddling with the form and seem to get only one color visible. Thje choices is to make it orange and also black, but the black color palette never shows up. Shreen shot:

https://gyazo.com/999de4edcc1ad1657af67ddb4dee9966

My code for this feature looks like this:


'widget_color_choices' => array(
'type' => 'section',
'label' => __('Colorchoice', 'zitac_products'),
'fields' => array(
'columns' => array(
'type' => 'color',
'label' => __('Choose color and background', 'zitac_products'),
'default' => '#dd9933',
'options' => array(
'Orange background white' => 'Orange background white',
'Black background white' => 'Black background white',
),
),
),
),
);
}

Any help would be greatly appreciated. Thank you.

Oh, and while I'm at it: if you run a Hero with several images that slides. Is there any way I could use a textbox with functionality to stop the slide to show only the first image of the slide?

Thanks again!

Bob

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

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

    Hi Robert,

    Unfortunately, the color form field doesn’t currently include an options field at this time. You can find a list of the possible options here. Can you please elaborate on how you would like these two colors to be directly linked? Based on your code, it may be better to have two color fields rather than one.

    If you would like to make a version of the color field with your desired changes you can, here’s how to create a custom form 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