WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.3k stars 4.11k forks source link

Patterns with page post type do not render within the Site Editor #45859

Open richtabor opened 1 year ago

richtabor commented 1 year ago

What problem does this address?

I'd expect that full page patterns, that are designed for pages — not necessarily posts, products, or any other custom post type (CPT), would be available within the Site Editor, to drop within templates.

Currently any pattern that declares a post type is ignored by the Site Editor, which is fine for most CPTs, but for pages - it means that full designs cannot be leveraged from the Site Editor.

What is your proposed solution?

I suggest that "page" post type patterns should always be available in the Site Editor.

Visual

Added a test page pattern to Twenty Twenty Three (page CPT):

CleanShot 2022-11-17 at 10 16 00@2x

As seen within the Site Editor; no page pattern:

CleanShot 2022-11-17 at 10 10 45@2x
bph commented 1 year ago

There is a feature that allows for the Page pattern to be loaded on Add New Page in the editor. Does that not work for you? Here is the Dev Note: Page creation patterns in WordPress 6.0

Your idea would be similar so a theme developer can offer more page layout patterns for both, page editor and site editor?

richtabor commented 1 year ago

There is a feature that allows for the Page pattern to be loaded on Add New Page in the editor. Does that not work for you?

That works fine and properly, but not exactly related.

My thought is that if a pattern is set to display on a Page Post Type, then it will not show up within the Site Editor (as its not that post type). I think it should be, as page patterns are useful for building out templates as well. :)

github-actions[bot] commented 1 year ago

Hi, This issue has gone 180 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps. Thanks for helping out.

github-actions[bot] commented 1 year ago

Hi, This issue has gone 30 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps. Thanks for helping out.

jordesign commented 1 year ago

Hey @richtabor - just looping through Stale issues and wanted to check in with you as to whether this is still relevant?

richtabor commented 1 year ago

Hey @richtabor - just looping through Stale issues and wanted to check in with you as to whether this is still relevant?

Yes, this is still an issue.

If I register a pattern (example gist) and assign it to only display for the page custom post type (I wouldn't want this About Page pattern to render on the "Choose a pattern" modal for any other custom post type) then it does not render within the Site Editor, where page CPT patterns are just as important.

Here's the pattern rendering on page creation, properly:

CleanShot 2023-07-11 at 14 13 11

And here it's missing from the Pattern inserter of the Site Editor (it should be under "Uncategorized"):

CleanShot 2023-07-11 at 14 17 58

youknowriad commented 1 month ago

I just tested this again and the pattern does show up for me. Closing as fixed but let me know if I missed anything.

richtabor commented 1 month ago

@youknowriad I'm pretty sure this is still occurring.

  1. Set WP_THEME_DEV to true

  2. Add this pattern to your theme's /patterns directory.

  3. Test WP Admin > Add new page

  4. See pattern:

CleanShot 2024-07-19 at 10 36 29

  1. Test Site Editor > Pages > Add new

  2. See no starter content modal, and no "TESTTEST" pattern in the inserter, even though the Post Type is defined as page:

CleanShot 2024-07-19 at 10 37 03

youknowriad commented 1 month ago

See no starter content modal, and no "TESTTEST" pattern in the inserter, even though the Post Type is defined as page:

If I'm not wrong, the "no starter pattern" there is because you're in "template visible" mode by default no?

richtabor commented 1 month ago

I just selected to add a new page in the Site Editor, just as I did in the post editor.