Skip to content

Block Template creation is using empty content instead of the appropiate fallback #36648

@MaggieCabrera

Description

@MaggieCabrera

Description

This was brought to my attention by @carolinan over at WordPress/twentytwentytwo#256

When a theme doesn't provide a template for a specific page (404, Search for example) we will always fallback through the hierarchy and show in the frontend an alternative existing template. In the case of TT2, if the search.html doesn't exist, the frontend will show index.html instead:

Screenshot 2021-11-19 at 13 49 46

This is inconsistent with what the flow of template creation is showing us. When you try to create a new Search template, we see no content at all:

Screenshot 2021-11-19 at 13 49 24

Screenshot 2021-11-19 at 13 49 40

This is inconsistent with what the user sees in the frontend before creating the template and forces them to create something from scratch.

Step-by-step reproduction instructions

  1. Install TT2, check in the frontend what a search results page returns
  2. Go to the Site Editor and try to create a Search template
  3. The Search template is empty.

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions