Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pattern block not expanded in Site Editor > Pages #52983

Closed
inc2734 opened this issue Jul 26, 2023 · 3 comments
Closed

Pattern block not expanded in Site Editor > Pages #52983

inc2734 opened this issue Jul 26, 2023 · 3 comments
Labels
[Block] Pattern Affects the Patterns Block [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Type] Bug An existing feature does not function as intended

Comments

@inc2734
Copy link
Contributor

inc2734 commented Jul 26, 2023

Description

  • In Dashboard > Pages, it is expanded.
  • I would like it to be expanded in Site Editor > Pages but it is not.
  • I noticed when using a custom template, once the custom template edit screen is opened, it is also expanded in Site Editor > Pages.

Step-by-step reproduction instructions

  1. Using TwentyTwentyThree theme.
  2. Create custom template. in themes/twentytwentythree/templates/my-template.html
<!-- wp:template-part {"slug":"header","tagName":"header"} /-->

<!-- wp:pattern {"slug":"core/query-standard-posts"} /-->

<!-- wp:template-part {"slug":"footer","tagName":"footer"} /-->
  1. Apply My Template to any page.
  2. Open Site Editor > Pages.
  3. Open the page to which you have applied My Template.

Screenshots, screen recording, code snippet

Kapture.2023-07-26.at.23.58.37.mp4

Environment info

  • WordPress 6.3 RC2
  • Twenty Twenty Three 1.1

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

@Mamaduka Mamaduka added Needs Testing Needs further testing to be confirmed. [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Block] Pattern Affects the Patterns Block labels Jul 26, 2023
@jordesign jordesign added the [Type] Enhancement A suggestion for improvement. label Jul 27, 2023
@ndiego ndiego added [Type] Bug An existing feature does not function as intended and removed [Type] Enhancement A suggestion for improvement. Needs Testing Needs further testing to be confirmed. labels Jul 27, 2023
@ndiego
Copy link
Member

ndiego commented Jul 27, 2023

I have confirmed this issue. The Pattern block that has been added to a custom template is not rendered when viewing a Page in the Site Editor. Note that if you view the template itself in the Site Editor, the pattern is rendered. So the issue appears to be isolated to the Page view in the Site Editor.

@aaronrobertshaw
Copy link
Contributor

I don't have a full explanation yet as to the true cause of the issue however it appears that the page content focus manager prevents the rendering of wp:pattern blocks when it disables block editing.

There's a small draft PR (#53166) with a tweak that gets wp:pattern blocks to show again although it hasn't been tested thoroughly yet and there might be unintended side effects or better approaches.

While exploring this issue I also found that some template parts that reference wp:pattern blocks provided via themes weren't displaying either.

Unfortunately, I'm out of time but will pick this up again tomorrow if needed.

@aaronrobertshaw
Copy link
Contributor

Closing this as fixed now that #53169 & #53206 have landed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Pattern Affects the Patterns Block [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Type] Bug An existing feature does not function as intended
Projects
No open projects
Development

No branches or pull requests

5 participants