last updated by  nazim47 6 months, 2 weeks ago
2 voices
3 replies
  • Author
    Posts
  • #3717
    nazim47
    Participant

    I am trying this way but It’s not working.

    Kirki::add_panel('ipage_topbar_panel', array(
    'priority' => 90,
    'title' => esc_attr__('Topbar Main', 'ipage'),
    ));
    
    Kirki::add_panel('ipage_topbar_sub_panel', array(
    'priority' => 12,
    'title' => esc_attr__('Topbar Sub', 'ipage'),
    'panel' => 'ipage_topbar_panel',
    ));
    
    Kirki::add_section('ipage_topbar_section', array(
    'priority' => 118,
    'title' => esc_attr__('Topbar setting', 'ipage'),
    'panel' => 'ipage_topbar_sub_panel',
    ) );
    
    Kirki::add_field( 'ipage-config', array(
    'type' => 'text',
    'settings' => 'email',
    'label' => ( 'Email', 'ipage' ),
    'section' => 'ipage_topbar_section',
    'default' => esc_attr( 'info@domain.com', 'ipage' ),
    'priority' => 13,
    ) );
    #3755
    MSR
    Keymaster

    Hi,
    Use below code, it now have a Panel > Section > Sub-Section.
    Explanation on the error, you must have 1 setting in each section.

    Kirki::add_panel('ipage_topbar_panel', array(
        'priority' => 10,
        'title' => esc_attr__('Topbar Main', 'ipage'),
    ));
        
    Kirki::add_section('ipage_topbar_sub_panel', array(
        'priority' => 10,
        'title' => esc_attr__('Topbar Sub', 'ipage'),
        'panel' => 'ipage_topbar_panel',
    ));
    
    Kirki::add_section('ipage_topbar_section', array(
        'priority' => 20,
        'title' => esc_attr__('Topbar setting', 'ipage'),
        'section' => 'ipage_topbar_sub_panel',
    ) );
    
    Kirki::add_field( 'sub_panel_field', array(
    	'type'     => 'text',
    	'settings' => 'my_setting',
    	'label'    => __( 'Text Control', 'textdomain' ),
    	'section'  => 'ipage_topbar_sub_panel',
    	'default'  => esc_attr__( 'This is a defualt value', 'textdomain' ),
    	'priority' => 10,
    ) );
    
    Kirki::add_field( 'ipage_config', array(
        'type' => 'text',
        'settings' => 'email',
        'label' => __( 'Email', 'ipage' ),
        'section' => 'ipage_topbar_section',
        'default' => esc_attr( 'info@domain.com', 'ipage' ),
        'priority' => 13,
    ) );
    #3756
    MSR
    Keymaster

    More information is available here -> https://wordpress.org/support/topic/nested-panels/

    You did not read that post earlier as-well, it clearly says:

    Note though that a panel without sections will not appear. So you must have at least 1 section in the paren panel as well”

    But again, a section without controls will not work, so you should have at leat 1 control in the parent section”

    #3758
    nazim47
    Participant

    Oh.. Thank You so much.
    Great Support.!

You must be logged in to reply to this topic.

Who’s Online

There are no users currently online

Members

  • Profile picture of winkly137
    active 6 hours, 28 minutes ago
  • active 11 hours, 40 minutes ago
  • Profile picture of Anjon
    active 12 hours, 46 minutes ago
  • Profile picture of vikasg1970
    active 18 hours, 54 minutes ago
  • active 20 hours, 50 minutes ago