Skip to content

Show Template with Template Parts, unable to select #76101

Closed

Description

@dannyreaktiv

Description

With an FSE template that is comprised of Template Parts, this leads to editing the Template Parts.

When trying to select any of the blocks within the Template Parts, including the Content block, the only block one can select is the Template Part, which leads to editing the template part, which is NOT what is wanted in this context.

Step-by-step reproduction instructions

Create a Single Posts template that is primarily composed of Template Parts, then go to edit a Post/Page with "Show Template" on.

I guess the fix is to use Patterns instead of Template Parts…?

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

Please confirm which theme type you used for testing.

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

Activity

  1. talldan commented on Mar 4, 2026

    @talldan
    Contributor

    This isn't something I can reproduce, it may have been fixed already or something else is happening. @dannyreaktiv would you be able to share a screen recording of the issue?

  2. talldan commented on Mar 4, 2026

    @talldan
    Contributor

    Just to clarify, it is true that template parts aren't editable when using 'Show template'. My understanding of of 'Show template' is that it only shows the template, it doesn't make it editable. The risk of making it editable is that users won't understand changes will apply to every single post that uses the template since they are still in the context of editing a single post.

    It is possible to double click on the template or template part to make edits.

    The part that I couldn't reproduce is being able to edit the post content, that works fine for me, even when post content is in a template part.

  3. dannyreaktiv commented on Mar 5, 2026

    @dannyreaktiv
    Author

    @talldan Thanks for responding.

    Here's a little video showing the issue on WP 6.9.1… the post Content block is in a Template Part. When "Show Template" is off, everything works as expected. When "Show Template" is turned on, I am not able to edit or interact with the post Content block. I can click on the Template Part and be taken to the Site Editor.

    I completely agree that there is a risk of making the Template Part editable when Show Template is on. However, it would be nice for blocks that are using context like postId or postType to remain editable/usable without changing the Template Part.

    Screen.Recording.2026-03-04.at.9.50.39.AM.mov
  4. talldan commented on Mar 6, 2026

    @talldan
    Contributor

    Thanks, I can reproduce the issue now, not sure why I couldn't before.

    Yep, I think you're right that post content should be editable in this situation. I'll look into a fix!

  5. self-assigned this
    on Mar 6, 2026
  6. dannyreaktiv commented on Mar 6, 2026

    @dannyreaktiv
    Author

    Thank you so much for taking the time to look into this.

  7. talldan commented on Mar 9, 2026

    @talldan
    Contributor

    I think this has been broken for a while, possibly since Template Parts: allow selection in page content focus mode, so a little while now.

    The PR description does say "Set the editing mode of children of core/template-part blocks to disabled, so that you're forced to click Edit in the toolbar.", it looks like this would include post content blocks.

    TemplateContentPanel: Don't show content blocks that are in a Query Loop is another PR that looks to have introduced an issue, the memoization of the getPostBlocksByName selector causes it not to recompute when controlled blocks (like template parts) update, so the selector doesn't return content blocks within template parts.

    This is quite a complex bug with several layers 😅

  8. added
    [Feature] Page Content FocusAbility to toggle between focusing on editing the page and editing the template in the site editor.
    on Mar 9, 2026
  9. talldan commented on Mar 11, 2026

    @talldan
    Contributor

    @dannyreaktiv Managed to find a way to fix this. The fix will be in Gutenberg 22.8 (which should be released on Weds 25th March) and also in the upcoming WordPress 7.0 release.

  10. dannyreaktiv commented on Mar 11, 2026

    @dannyreaktiv
    Author

    This is incredible. Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

[Block] Template PartAffects the Template Parts Block[Feature] Page Content FocusAbility to toggle between focusing on editing the page and editing the template in the site editor.[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