3

I have created a Page template in the Appearance > Editor after creating a Header template part. In this Page template, I set up columns, image placeholders, text and headline placeholders, page title, etc. It was easy to create and looked fine.

I was also editing theme.json all along the way. I never used the Global Settings capability in the actual editor, but did tweak spacing using the Dimension tools, etc.

The Issue: The content I created on a new page appears with the new template on the client side as I expected, but it does not appear in the site editor when editing the page.

I was under the impression that full-site-editing meant I could populate, style, and edit a page right in a "shell" of the Page template I created, 100% wysiwyg. Instead, all I see is raw text and images—no columns, header, etc., and nothing from the template. Note: the fonts and sizes set in theme.json are showing up fine.

So, is what I'm asking possible or am I not understanding FSE and templates?

1 Answer 1

2

When creating a page template in Appearance > Editor you can add a Post Content block. This is where the page content goes. Everything else is part of the template and applies to all Pages that use the template.

When you go to Pages > All Pages and select a page to edit, or use Edit Page in the admin bar, it will open the block editor for editing the page's content. From here you are only editing the contents of the Post Content block for that page.

Editing the template is the equivalent of editing page.php for classic themes, and the Post Content block is the equivalent of the_content() as used by classic themes.

However, while editing a page, if you edit the template by clicking Page > Summary > Template > Edit template it will open a view where you can edit the page template and the page content simultaneously. This will allow you to see the page content in the page template. It's important to note that any changes you make outside of the Post Content block will be saved to the template, meaning that they will apply to all pages. Changes made inside the Post Content block will be saved for the current page. If you make changes to both you will be asked which changes you'd like to save when you press Update.

If you want to create a set of blocks that acts as a starting point for the Post Content of a page then the feature you're looking for is Block Templates.

1
  • Got it. I guess "templates" means different things for different applications, e.g., word processing and desktop publishing.
    – breadwild
    Feb 9 at 14:33

Your Answer

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

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