I'm creating custom pages using Pages + Layout Builder. These layouts need to be stored in GIT as config files (drush cex). Currently, the layouts themselves are stored fine.

The main problem is that custom block contents are stored in the database and if someone clones the repository and applies changes using drush cim, they are missing the block contents.

1 Answer 1


Then don't use custom block types because they are stored in content entities.

Use blocks storing only configuration. You can build a custom block plugin, even with a body field. See Custom block build function to display wysiwyg body text

There are also some contrib options like Simple Block which is implementing a config entity for blocks.

  • 1
    Thank you! I've opted to use the Simple Block module. The only downside seems to be, that there is no way of creating Simple Blocks directly in Layout Builder (like custom blocks). Will go ahead and create an issue for that.
    – Elaman
    Commented Dec 3, 2020 at 1:41
  • @Elaman Please provide a link to the issue. Thanks!
    – colan
    Commented May 5, 2023 at 16:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.