• Resolved JohnDBB

    (@johndbb)


    Hello,

    I would like to extend the columns block changing/adding predefined layouts.I have searched and searched but I have found nothing clear about it ((

    Any help would be greatly appreciated!

    Thank you in advance

    • This topic was modified 4 years, 9 months ago by Jan Dembowski.
Viewing 6 replies - 1 through 6 (of 6 total)
  • How are you looking to extend? I looking for ways to customize what is there using CSS or are you a developer wanting to extend the functionality with code?

    Thread Starter JohnDBB

    (@johndbb)

    Thank you Leslie

    I’m a developer. I have seen that the columns block layouts are included in a variations constant, but I have not found yet how to override or extend it with new layouts. If I get it I will post it here.

    Best

    Thread Starter JohnDBB

    (@johndbb)

    I have found how to do it:

    wp.blocks.registerBlockVariation( ‘core/columns’, { name: ‘custom’, title: ‘Smiley’, isDefault: true, innerBlocks: [ [ ‘core/column’, { width: 33.33 } ], [ ‘core/column’, { width: 66.66 } ] ], icon: ‘smiley’, scope: [ ‘block’ ] } );

    But I would like to add also a custom class to the variation.Any tips about how to get it?

    Thank you in advance

    Thread Starter JohnDBB

    (@johndbb)

    Found it

    wp.blocks.registerBlockVariation( ‘core/columns’, { name: ‘custom’, title: ‘Smiley’, isDefault: true, innerBlocks: [ [ ‘core/column’, { width: 33.33 } ], [ ‘core/column’, { width: 66.66, className: ‘custom’ } ] ], icon: ‘smiley’, scope: [ ‘block’ ] } );

    Thread Starter JohnDBB

    (@johndbb)

    Resolved

    Glad you found it. Sorry I didn’t get back sooner. For reference to anyone who finds this in a search, block filters on www.remarpro.com should be helpful.

    Thanks for updating as resolved.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Extending Columns Block’ is closed to new replies.