Page/Post template in Gutenberg block

Hi friends. I want to ask a question:
Can we use post/page templates in Gutenberg block? Can we do it with shortcode or plugin?
I want to use templates in a page with some text and others, is this possible?
Anyone here tried this and found any solution?
So much thanks…

Hi @aliveli,
I’m not quite sure I understand your question. Within WordPress you can have multiple templates for posts and pages. This is whether you are using Gutenberg or the classic editor. They are available from the settings box along the right side of the page/post.


If I had different templates, they would appear under page attributes. The action that you have highlighted above allows you to give a specific name to the template.
Hope this helps,
Bob

Thanks for your reply. When I select template it shows there in page attributes. But I want these templates to show in gutenberg blocks like in this pic.
is this possible?

Hi @aliveli,
So you want to make a custom block that contains multiple HTML elements?

If so, there is a plugin (maybe several) that helps you do this. Here is a tutorial link - note that they changed the name of the plugin used from Block Lab to Genesis Custom Blocks, but I think it still has the same functionality. With it you register the block editable fields from the admin area. Then you add a custom block file to your theme. That file is a mix of HTML and PHP, so pretty much like what you can create now with Pinegrow except that the PHP will have to be in code blocks since none of them are hard-coded into Pinegrow.

Otherwise, the blocks need to be written in React/JSX which Pinegrow doesn’t handle well, at the moment.

Hope this helps.

thanks so much. I checked it, I can build custom blocks but the problem is; I designed some page templates. they look well. I want to use these templates with gutenberg in editor. I am searching to use my page templates in gutenberg blocks.
so much thanks.