Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Group_Control_Background not working properly when i try to make new widget #3026

Closed
bdthemes opened this issue Dec 28, 2017 · 5 comments
Closed
Labels
type/developer-api Indicates when a topic is related to the Developer API and Documentation.

Comments

@bdthemes
Copy link

Description

Hello, I am trying to make a custom widget element called slideshow. but this control not work as i expected:

$repeater->add_group_control(
	Group_Control_Background::get_type(),
	[
		'name'  => 'slide_background',
		'types' => [ 'classic', 'gradient', 'video' ],
		'fields_options' => [
			'background' => [
				'frontend_available' => true,
			],
			'video_link' => [
				'frontend_available' => true,
			],
		],
		'selector' => '{{WRAPPER}} {{CURRENT_ITEM}}',
	]
);

background color not change it's always show transparent. but i saw in column and section it's working fine there. can you tell me what i wrong or is it a bug?

When i pick background image it's working fine: http://prntscr.com/ht8dir

Please give me a right solution.

Steps to reproduce

Look here:
http://prntscr.com/ht8amj
http://prntscr.com/ht8dir

Environment

Look here: https://pastebin.com/5DPf8HHq

@bainternet
Copy link
Contributor

@bdthemes

can you provide a link? the widget code? so we can take a look?

@bainternet bainternet added the status/needs-feedback Indicates when an Issue, Pull Request, or Discussion awaits Feedback from the poster. label Dec 28, 2017
@norewp
Copy link

norewp commented Dec 29, 2017

Group Controls do not work inside of repeaters! You'll have to use the standard Controls_Manager::COLOR for the background color.

@bdthemes
Copy link
Author

Hello @bainternet, I am working locally. here you get the repeater code: https://pastebin.com/uiMHZ1vY

Hello @norewp, So how can i use gradient control? How can get this type of organize layout view: http://prntscr.com/htqbfy ?

@bainternet bainternet added type/developer-api Indicates when a topic is related to the Developer API and Documentation. and removed status/needs-feedback Indicates when an Issue, Pull Request, or Discussion awaits Feedback from the poster. labels Dec 31, 2017
@bainternet
Copy link
Contributor

@bdthemes

Like @norewp said, Group Controls don't work inside a repeater.

So in order to get the desired layout, you would need to add all tabs and controls manually.

But then again you can't have nested tabs, so I would suggest adding all fields required for all background types and only show them based on a select control which will hold the background type as a condition.

Hope this makes sense.

@Deepak8622
Copy link

Can anyone help regarding how to build custom slider using repeater with example?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/developer-api Indicates when a topic is related to the Developer API and Documentation.
Projects
None yet
Development

No branches or pull requests

4 participants