• Resolved Tim

    (@timstl)


    Hello,

    I think I discovered a bug while implementing a template in a custom post type. While adding a new post, the top and bottom padding settings are reset back to the Kadence defaults, ignoring what’s in the PHP template. (I’m assuming other settings reset back to default but haven’t tested everything.)

    The reason I think this is a bug is because the block appears to start with my defaults, and then a second or two later resets back to 25px. So I think I have the template right, and javascript is overwriting it after the page loads.

    Here’s the array I’m using as my template, for reference.

    array(
    	array(
    		'kadence/rowlayout',
    		array(
    			'columns'       => 1,
    			'colLayout'     => 'equal',
    			'topPadding'    => 100,
    			'bottomPadding' => 100,
    			'bgColor'       => '#f5f0ec',
    			'align'         => 'full',
    		),
    		array(
    			array(
    				'kadence/column',
    				array(),
    				array(
    					array(
    						'acf/quoteadvanced',
    						array(
    							'data' => array(
    								'quote' =>
    								array(
    									0 => 'with_small_photo',
    								),
    							),
    						),
    					),
    				),
    			),
    		),
    	),
    );
    
Viewing 3 replies - 1 through 3 (of 3 total)
  • Hey,
    You can add “noCustomDefaults” to your markup so that the defaults set in the block defaults get ignored.

    For example:

    array(
    	array(
    		'kadence/rowlayout',
    		array(
    			'columns'       => 1,
    			'colLayout'     => 'equal',
                            'noCustomDefaults' => true,
    			'topPadding'    => 100,
    			'bottomPadding' => 100,
    			'bgColor'       => '#f5f0ec',
    			'align'         => 'full',
    		),
    		array(
    			array(
    				'kadence/column',
    				array(),
    				array(
    					array(
    						'acf/quoteadvanced',
    						array(
    							'data' => array(
    								'quote' =>
    								array(
    									0 => 'with_small_photo',
    								),
    							),
    						),
    					),
    				),
    			),
    		),
    	),
    );

    Ben

    Thread Starter Tim

    (@timstl)

    Ah, thank you. Worked like a charm.

    You bet!

    Basically in the blocks you can set custom defaults, those are defined when the block is mounted if it’s a newly created block so adding the noCustomDefaults just tells the block while it’s being mounted to ignore any custom defaults set in the kadence controls settings.

    Ben

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘custom post type template / kadence row bug’ is closed to new replies.