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

Ability to nest sections #3

Open
bahiirwa opened this issue Jul 29, 2019 · 8 comments
Open

Ability to nest sections #3

bahiirwa opened this issue Jul 29, 2019 · 8 comments
Labels
enhancement New feature or request
Milestone

Comments

@bahiirwa
Copy link
Collaborator

Probably this is an enhancement. But would love to be able to nest some sections

@BaronVonPerko
Copy link
Owner

What would this look like? Do you have an example of functionality you'd like to reproduce here?

@bahiirwa
Copy link
Collaborator Author

Let’s say I want to have some fields for some homepage sections and then have some more for the about us page. I hope that paints a proper picture

@BaronVonPerko BaronVonPerko added the enhancement New feature or request label Jul 30, 2019
@BaronVonPerko BaronVonPerko added this to the v1.1 milestone Jul 30, 2019
@bahiirwa
Copy link
Collaborator Author

bahiirwa commented Sep 14, 2019

Just some clarity on expected behaviour. I have been looking into this for a theme I am building.
I think they are referred to as panels. I have added some sample code for testing. You will notice the section hooks into the set up panel.

$wp_customize->add_panel( 'theme_option', array(
        'priority' => 60,
        'title' => __( 'Whiteboard64 Theme Option', 'whiteboard64' ),
        'description' => __( 'Lets configure your site with Whiteboard64 Theme Option', 'whiteboard64' ),
    ));    

    /** SOCIAL ICON LINKS SECTION **/

    $wp_customize->add_section('whiteboard64_social_section',array(
        'priority' => 1,
        'title' => __('Social Media Section','whiteboard64'),
        'description' => __('Customize Social Section in Homepage. Make sure that you have filled all the social links, blank field will not be displayed in site and it will be hidden by default.', 'whiteboard64'),
        'panel' => 'theme_option'
    ));

    $wp_customize->add_setting(
        'facebook_link',
            array(
            'sanitize_callback' => 'esc_url_raw',
            'capability' => 'edit_theme_options',
            'default' => '',
    ));
    $wp_customize->add_control(
        'facebook_link',
            array(
            'label' => __('Facebook link URL', 'whiteboard64'),
            'section' => 'whiteboard64_social_section',
            'settings' => 'facebook_link',
            'type' => 'url',
    ));

@BaronVonPerko
Copy link
Owner

Ahh thanks for the example! I'll make it happen! 👍

@BaronVonPerko
Copy link
Owner

I've updated the way the sections are saved, which will allow me to easily create a panels section in the option settings. Still trying to figure out the best way for the UI to work, as these panels are optional and can have several sections associated with them.

@BaronVonPerko BaronVonPerko modified the milestones: v1.1, v1.2 May 31, 2020
@AbhijithHaridas
Copy link

Hey @BaronVonPerko, I'm a fan of your work

Is this completed and deployed?

@BaronVonPerko
Copy link
Owner

Hi @AbhijithHaridas! I haven't had time to work on this feature lately, but if you want to take a stab at it, I welcome all PRs!

@BaronVonPerko BaronVonPerko modified the milestones: v1.2, v2.0 Mar 10, 2021
@BaronVonPerko
Copy link
Owner

Moved this issues to the 2.0 milestone. It's going to be much easier to implement it in that code base.

@BaronVonPerko BaronVonPerko modified the milestones: v2.0, v2.1 Aug 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants