Register block variation for specific template part
-
Hi,
How do I add a block variation for a specific part of the template? I’m trying to add a sticky header variation, but it’s showing up in every part of the template. Here is sample code:
wp.blocks.registerBlockVariation('core/template-part', [ { name: 'sticky-header', title: __('Sticky Header'), attributes: { area: 'header', className: 'site-header is-sticky', }, scope: ['transform'], }, { name: 'static-header', title: __('Static Header'), attributes: { area: 'header', className: 'site-header is-static', }, scope: ['transform'], }, ]);
Any ideas? Thanks!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Register block variation for specific template part’ is closed to new replies.