-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add ability to use "Page creation Patterns" for custom post types #41304
Comments
Great idea. I think the reasoning why this isnt here for full page patterns in CPT's may be this: Custom post types usually have a specific layout. We can already prefill post types with blocks when registering a post type with the 'template' array. It would be amazing if we could refer to an existing pattern file here (from /patterns dir in theme). If we could add an array with two or more templates? We could auto fill the 'page creation modal' with a choice between two variations of the CPT template. Proposed method of refering to template instead of block markup:
Proposed method with multiple pattern files.
Additionally:A more abstract issue coupled with this is: What is the difference between a 'template' and 'page-creation-pattern', in the eyes of a client / non-dev user? These two concepts become a bit entangled and the more I think about this, the less it makes sense to make a distinction between a template and a full-page-pattern. |
Thank you all for the discussion that happened. I proposed an implementation for this issue at #41791. |
I see this is the same proposal as #41398. @jorgefilipecosta take a look at the API I propose there, I think it's clearer. |
What problem does this address?
This would be a follow up from #38787. It is now possible to mark patterns as full page patterns by setting
blockTypes
toarray( 'core/post-content' )
. Currently this feature is limited to the Page post type however.What is your proposed solution?
It would be great to also add support for custom post types to use the page creation patterns.
It would also be great to have a way to determine which patterns should get shown for which Post type. If I imagine a "Product" custom post type it would be super useful to only show various product-specific patterns that already use product CPT specific blocks in it.
At the same moment, it would be really valuable to have some programmatic way to opt-in or out of the modal altogether for certain post types.
The text was updated successfully, but these errors were encountered: