Ask Your Question
3

What is the method for utilizing the fields_options parameter in the Elementor Background Group Control?

asked 2022-12-11 11:00:00 +0000

devzero gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2021-07-14 22:00:00 +0000

lakamha gravatar image

The fields_options parameter in the Elementor Background Group Control allows for customized options for background fields such as image, color, gradient, and video.

To utilize this parameter, follow these steps: 1. Open the Elementor editor and select the section or widget where you want to add a background. 2. In the Style tab, under the Background section, click on the Background Type dropdown and select Group. 3. Click on the Fields Options field to access the options. 4. The fields_options parameter accepts an array of options in key-value pairs. For example:

'fields_options' => [
  'image' => [
    'default' => [
      'url' => '',
      'id' => '',
    ],
    'upload_button' => true,
    'dynamic' => [
      'active' => true,
      'default' => Elementor\Repeater::create([
        [
          'name' => 'url',
          'type' => \Elementor\Controls_Manager::MEDIA,
          'label' => __( 'Background Image', 'textdomain' ),
          'dynamic' => [
            'active' => true,
          ],
        ],
      ]),
    ],
  ],
  'color' => [
    'default' => '',
    'inline_control' => true,
  ],
  'gradient' => [
    'default' => '',
    'type' => \Elementor\Controls_Manager::GRADIENT,
    'toggle' => true,
    'hue' => [
      'saturation' => 80,
      'lightness' => 60,
    ],
  ],
  'video' => [
    'default' => '',
    'type' => \Elementor\Group_Control_Video::get_type(),
  ],
],

In the above example, there are options for the image, color, gradient, and video fields. For the image field, there are options for the default value, upload button, and dynamic options. For the color field, there is an option for an inline control. For the gradient field, there are options for default value, type, toggle, and hue. For the video field, there is an option for the default value and type.

  1. Customize the options according to your needs.
  2. Save the changes and preview the result.
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-12-11 11:00:00 +0000

Seen: 12 times

Last updated: Jul 14 '21