Create Gutenberg Block from Template

Working with Pagebuilder is great. However creating Blogposts should be done in Gutenberg and for this it would be great if we could create Gutenberg Blocks out from a Bricks Template Content. These Blocks can then be selected in the Gutenberg Editor. This is possible already by using a shortcode block. But the content is not visible and the whole handling is absolutely not user friendly (for the customers).

Every Block should be connected with a Bricks template, so if changing the template, the connected blocks are changed everywhere (kind of reusable blocks).

Later on the functionality could maybe be extented to change some content/properties of the block individualy in the post where it is inserted. …But even without this extended functionality, we could allready create prepared dynamic blocks for the client.

What also would be great if the width of the gutenberg post editor could inherit the width of the applied bricks post template. So when inserting the blocks, it looks allready pretty close to real experience on front end.

To make it perfect - but maybe it’s just an impossible dream - it would be perfect if the whole layout of the applied post template will be reflected in the gutenberg editor, so then it really looks like on front end.

1 Like

Have a look at Pinegrow… its a little complicated, but that is exactly how it works. It also isn’t a classic page builder, rather a block theme builder. It is a desktop app, but is also being released soon as a plugin that can be deinstalled when the page/theme build is finished (optional)

Btw I am pretty sure you can post any Bricks section using a Shortcodes in Gutenberg. Only thing not possible are components (meaning having variants based on settings), but this is discussed in bricks components on this forum and I have been challenged to find a work around (by the master himself @Daniele). Let’s see if I can step up to the table on this one.

thank you. Yes I know about the Shortcode and I mentioned this in my description.
The problem is it’s not rendered in backend, so for my clients its totaly unfriendly (like the whole gutenberg thing, terrible)

Hi @Goninski, welcome here and thanks for your feature request! :slight_smile:

I don’t think this is possible without interfering with the Bricks Core. Outputting the graphical content of a Bricks template is one thing. Making the template editable is another. The Vue context is no longer there. Since we currently don’t have access to the store from outside, I don’t see a future-proof way to build such a functionality.

I think to make visible the template content would already be a great thing. So then the customer can just pick prepared blocks (with dynamic content) and arrange them however he wants. I think this would be a great extend of the Bricks functionality

So, you mean a Gutenberg block that generates a list of Bricks Section Blocks as a dropdown (or fancy with a small preview) but in fact is only the short code block with an interface. That should be doable, if that is what you mean.

Additionally, I think he want a live representation from the template how it would look in the frontend. So the shortcode needs to be parsed inside Gutenberg (does this work? Never worked with Gutenberg except of writing articles :grin:) and, while Bricks does not autoload all styles for the element css classes, I would use some Bricks helper functions to load the needed Stylesheets.

But I still think about if this one is really needed for Bricksforge :thinking: Hmmm….

1 Like

Oh, yeah, you’re right. I totally left that aspect out. Just shows “Gut Ding braucht Weile”… I am too quick at the reply button. Should let it simmer a moment longer.

yes, in fact its ‘just’ a library of specific bricks templates which can be selected and inserted in gutenberg as a block, including a preview and then showing up fully rendered like on frontend.

If its for Bricksforge I can’ t tell (what is the goal definition of Bricksforge?) I also cannot tell how difficult this would be to realize. But I’m pretty sure it would be a very nice and stand out feature which solves a common problem within wp. Right now there is no other solution than creating different post templates for different situations, which does not bring the same flexibility for the customers.

I have really missed that block feature from day one of the birth of Bricks.
Have clients with a crazy mess of shortcode in the wp editor and its annoying to search for the right shortcodes. I not a developer but 4hat must be possible.

This is basically what ACF Flexible Content is for.

Elementor did this well, basically you can create templates for the various layouts you create (using Elementor) using ACF Flexible Content, and dynamically pull the data into the template. Examples can be seen here:

When I used Elementor, it was game changing for certain projects, because clients could easily create advanced layouts based on templates I provided. They would just focus on content.