generateblocks
generateblocks copied to clipboard
GenerateBlocks not styled in the block editor if imported via reusable block and php code (not usual reusable block import)
Description
I save a GenerateBlock design as a reusable block and import it into the pages via a custom ACF Block (not via the usual reusable block block). All blocks are rendering correctly in the frontend but GB blocks are not styled in the block editor.
Here is Tom's explanation:
Ah, I understand now. Your code is rendering the frontend block in the editor. While some plugins add the
However, the code that adds that inline
We’ll need to recreate your setup and then figure out a way to improve that function to be smart enough to see that we’re in the editor.
Steps for testing
- You find the code for testing here: https://github.com/julian-stark/dynamic-reusable-block/tree/gb-block-editor-testing/stark-dynamic-template
- Install ACF Pro
- Save a GB based reusable block and import it into a page.
- Check how the styling of the reusable block looks inside the block editor.
I will create a staging environment with the testing setup for you if you like.
References:
Please see discussion in GP support ticket: https://generate.support/topic/generateblocks-styling-in-block-editor-not-working-reusable-block-via-php/