Template blocks not showing in Gutenberg page editor

[ad_1]

I’m working on building a block theme for the Gutenberg editor, and I’ve hit a roadblock.

I have defined several page templates in my theme templates folder (front.html, about.html, gallery.html, contact.html). I have registered them in theme.json, and I am able to see them and edit them in the Gutenberg editor. If I add content to the template, I can see the content in the live site.

My issue is on the page editor (when I go to Pages in the Dashboard and click on Edit for a page). I can see the templates in the page settings, and I can select different ones. However, I can’t see any of the blocks I have defined in the templates in the page editor. I only see one or two empty paragraph blocks, and if I add content via the page editor, it does not show on live site; only the template placeholder content is shown.

I thought that you were meant to define the blocks that appear on a page in the templates and that those blocks would appear in the page editor for you to populate with content when you make a new page. Is this not the case? It seems like I have to basically build each page in the template file or editor and that the page editor is completely useless.

I’m sure I’m misunderstanding how this is supposed to work or missing some fundamental step, and I’m hoping a kind person here can help point me in the right direction. Thank you!

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer