• Resolved nick6352683

    (@nick6352683)


    I started testing this plugin today, because the feature list is impressive, but I did run into field column widths issue, and found a way to get around it.

    Testing environment, WP5.3.3, ACF Pro 5.9.3, ACF Extended (latest) – fresh WP installation.

    When creating a Field Group, and if you have this plugin activated, all the Width settings for the fields are ignored in the backend. This is true for Meta Boxes, or for Gutenberg Blocks. So, if I have 3 fields with each width value of 33%, the fields are shown under each other, instead of next to each other, each occupying a third of the editor width. I could not find a way to fix this at this point.

    A fix so far, and I need to do more testing what else gets broken, is to disable this plugin (ACF Extended), have ACF activated of course, and then create the Fields Groups. A quick check will verify that the field widths are now honored. At this point, activating the ACF Extended does not “ruin” the width settings – all is fine.

    So, do not activate the ACF Extended plugin before you create the Field Groups. Activate this plugin AFTER you create the field groups in ACF.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Thanks for feedback! I think you’re misinterpreting the “label Placement” field group setting tho. This setting control the way the field labels are rendered (Left or Top of fields). You’ll find this setting at the bottom of the field group setting. See screenshot: https://i.imgur.com/9ozXY14.jpg

    By default, ACF set the “Label Placement” of newly created field groups to “Top”. ACF Extended change that default behavior and set the label placement to the “Left” by default, for newly created field groups.

    There is a technical limitation on the “Label Placement: Left”, it doesn’t take in account fields “width” settings, because the labels are already forced to the left with a grey background color.

    This is why your workaround is working: creating a field group with ACF only, then activate ACF Extended. Because ACF Extended only change the default Label Placement when creating a new field group. Of course, even with ACF Extended you can change that default value back to “Top” and it will work as expected.

    Now as of why using “Label Placement: Left” by default in ACF Extended: Left aligned fields are designed for complex field groups which have many fields. This way, the UI keeps things more clean, and clearly separate field labels from actual fields input. It’s a more sophisticated version of the native WP admin screens (label on left, input on right). See screenshot: https://i.imgur.com/c7ZGZsf.png

    You can decide to change that default ACF Extended behavior if that’s really something that annoy you, and you don’t want to always set that setting back to “Top” when creating a new field group. To do so, you can add the following code in your functions.php file:

    add_filter('acf/validate_field_group', 'my_acf_default_label_placement', 20);
    function my_acf_default_label_placement($field_group){
        
        // Bail early early if it's not a new field group
        if(acf_maybe_get($field_group, 'location'))
            return $field_group;
        
        // Default label placement: Top
        $field_group['label_placement'] = 'top';
        
        return $field_group;
        
    }
    

    Hope it helps!

    Have a nice day.

    Regards.

    Thread Starter nick6352683

    (@nick6352683)

    Holy crap Konrad, I did not realize those settings at the bottom, thanks for your response and the time you spent to prepare your answer. I need to familiarize myself more to this plugin, but after 3-4 hours of use I am impressed, and I will try everything you suggested.

    In a few days I will also rate this and probably upgrading to the Premium version, I can do most stuff this plugin offers manually code wise, but with this, I will be able to save some dev. time. It’s not a big deal for me, and maybe I missed it, ACF Extended can register Gutenberg Blocks, but not Block Categories…

    Thanks for everything, me finding this plugin today was nice, early Christmas gift !!!

    Thread Starter nick6352683

    (@nick6352683)

    Konrad, after testing, your explanation was PERFECT !!! I now understand the problem, why the issue happened and how to fix it. Simply changing the label position from left to top solves the issue, and I wish I knew this this morning (I almost threw my laptop out the window, now glad I did not !!!)

    Thanks again!

    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    I almost threw my laptop out the window, now glad I did not !!!

    Haha! I’m glad you liked my answer. As you can see in my profile history I favor high quality support, but it takes time. It’s one of the reason why I decided to release ACF Extended Pro. Right now I’m really busy with the upcoming update so I don’t have much time to answer questions here (most of them are just questions, not really bug reports tho).

    I didn’t know that you could create Block Categories (I’m not a Gutenberg user). But I like the idea and it shouldn’t be too hard to implement. I added the feature request on the Trello board: https://trello.com/c/qTTiGDDI/474-dynamic-block-type-add-cateogries

    I can do most stuff this plugin offers manually code wise, but with this, I will be able to save some dev. time.

    You totally get the philosophy of the plugin here! Saving time for developers and provide them more tools!

    Side note: If you really want to have columns with the “Label Placement: Left”, you can use the ACF Extended: Columns Field. You should definitely try it if you like columns!

    The result is… special, but I thought some people would like to have it: https://i.imgur.com/tElJWnT.jpg More options, more fun! 🙂

    Have a nice day!

    Regards.

    Thread Starter nick6352683

    (@nick6352683)

    Here is an example in php, I use it just before I register my blocks for my themes, to create a category called “Theme Containers”…

    // Add Gut Category - Theme Containers
    add_filter( 'block_categories', function( $categories, $post ) {
    	return array_merge(
    		$categories,
    		array(
    			array(
    				'slug' => 'theme-containers',
    				'title' => __( 'Theme Containers', 'wptc_theme_td' ),
    			),
    		)
    	);
    }, 10, 2 );

    Things for a person like you should be self explanatory…

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Field Column Issues’ is closed to new replies.