Follow us on

Codestar Support Forum » WordPress Plugins » Codestar Framework

Switcher first for enable other sections on/off

  1. Hi,
    I'm working on Customizer Settings. I want to create a Switcher on very first. And other sections are dependency on the Switcher On/Off
    Example: https://prnt.sc/11901ba

    Please give me the solution.

    Thanks

    Posted 2 years ago #

  2. Codestar
    Admin

    Hi,

    Yes it's possible. There is a 4th paramater for allow to control the others sections. for eg:

    array(
      'id'         => 'opt-depend-switcher',
      'type'       => 'switcher',
      'title'      => 'If switched to (ON)',
    ),
    
    array(
      'type'       => 'notice',
      'style'      => 'success',
      'content'    => 'Success: Switched to (ON).',
      'dependency' => array( 'opt-depend-switcher', '==', 'true', 'all' ), // take a look here 4th/last parameter "all".
    ),CopyCopied!

    Also you can get more info from documentation: http://codestarframework.com/documentation/#/faq?id=how-to-use-dependencies-

    Regards, Codestar

    Posted 2 years ago #
  3. You didn't get my point. I didn't ask for how dependency works.
    My problem is: I want to make settings like -

    1. Please check the Box Mark:https://prnt.sc/11901ba
    I want a Switcher here. I can't do it with CSF.
    2. After the Switcher Other sections will as it is. I will make dependency if the Switcher Enable/Disable.

    Hope you understand now.

    Posted 2 years ago #

  4. Codestar
    Admin

    Hi,

    Oh understood. Unfortunately, it's not possible.

    The similar question came 2 days ago: http://support.codestarthemes.com/topic/hide-entire-sections-until-a-field-equals-x

    Regards, Codestar

    Posted 2 years ago #
  5. Hi,
    Please consider to make a solution for this. Since it's required on some cases.
    Thanks

    Posted 2 years ago #

  6. Codestar
    Admin

    Hi,

    Yes, I noted this request for next updates.

    Regards, Codestar

    Posted 2 years ago #