kirki icon indicating copy to clipboard operation
kirki copied to clipboard

Suggestion

Open Serpentsoft opened this issue 11 years ago • 3 comments

Hey @aristath

I met a complicated scenario but it's not an issue in KIRKI, However i create a new section to change the main website's background so i have 3 options (None, Pattern and Custom Background) in radio buttons and every option must have some nested controls so i want a nested (Divs) with unique Ids inside the current section to show/hide it using jQuery depending on user selection (None, Pattern, Custom).

I search for it but i cannot call add_control function inside Div tag because the div created before initialize add_control.

I tried to use a [custom] type with default value [

] and add some controls then add another custom control with value [
] close tag BUT it also created outside the controls.

I have no ideas right now but i believe it will be a good option for organizing inside sections.

If you have any suggestions i'm all ears, Thanks.

Serpentsoft avatar Oct 01 '15 19:10 Serpentsoft

What if you just show/hide controls based on the values of the background-type setting? You could for example use the required argument (some basic docs can be found on https://github.com/aristath/kirki/wiki/required) So you can add all your options as separate controls and then decide which ones you're going to show or hide based on the value of others.

It's not nested, but it will get the job done...

aristath avatar Oct 01 '15 19:10 aristath

WoW, It's working v. well .. but the radio button control's Transport must not postMessage, But it's good. Thanks dude.

Serpentsoft avatar Oct 01 '15 20:10 Serpentsoft

Yeah, the transport has to be set to refresh. A small price to pay though... :P I'm glad I could help!

aristath avatar Oct 01 '15 20:10 aristath