Skip to content

Site Editor Uses Incorrect Template #66687

@mdawaffe

Description

@mdawaffe

Description

Since #66579, the Site Editor has changed which template it uses.

In current trunk, the Site Editor uses the template from /wp/v2/templates/lookup&slug=front-page&_locale=user.

In Gutenberg 19.5.1, the Site Editor uses the template from /wp/v2/templates/lookup&slug=page-{$page_slug}&_locale=user.

Depending on the theme, the templates returned by those two requests can be very different.

Step-by-step reproduction instructions

  1. Create a page.
  2. Set that page to be your site's homepage (page_on_front).
  3. Switch theme to Twenty Twenty-Four.
  4. Go to wp-admin/site-editor.php?canvas=edit
    • In Gutenberg 19.5.1, you'll see the title and contents of the page you created in step 1. In the Page settings sidebar, note that it's using the "Pages" template (or whatever template you gave it.)
    • In current trunk, you'll see the Twentytwenty-Four default homepage. In the Page settings sidebar, note that it's using the "Blog Home" template.

Screenshots, screen recording, code snippet

Reading Settings:
Reading Settings

19.5.1 Trunk
Gutenberg 19.5.1 Current Trunk

Environment info

WordPress: 6.8-alpha-59335
Gutenberg: 49c3bf9 (behavior changed in #66579)
Theme: Twenty Twenty-Four

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

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Metadata

Metadata

Assignees

Labels

[Feature] Templates APIRelated to API powering block template functionality in the Site Editor[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions