sage
sage copied to clipboard
Feature Request: Blade Support for Patterns
Terms
- [X] I have read the guidelines for Contributing to Roots Projects
- [X] This request is not a duplicate of an existing issue
- [X] This is not a personal support request that should be posted on the Roots Discourse community
Summary
With WordPress 6.0 it got very easy to register new Patterns by throwing them as PHP files into the /patterns folder: https://make.wordpress.org/core/2022/05/02/new-features-for-working-with-patterns-and-themes-in-wordpress-6-0/
That folder is located in the theme root, also with Sage 10. It would be great to have Blade support for the Pattern files and to move the folder to the other /views.
Motivation
Why are we doing this?
Patterns are very powerful and can be used for Block Templates.
What use cases does it support?
With Blade support it would be possible to build on the pattern system also with FSE outlook.
What is the expected outcome?
Blade support within Pattern files
Additional Context
No response
https://github.com/WordPress/WordPress/blob/a5cc224b3c5a5d983673f5f8ec4b3a7ae9e97f27/wp-includes/block-patterns.php#L225 unfortunately wordpress doesn't provider a filter for the patterns directory
i think that the ideal scenario would be that patterns would be created at resources/views/patterns and compiled to somewhere that isn't patterns. but since we can't do that, we would then have to gitignore the theme patterns directory.
it seems like whatever way we were to do this right now would be a bit janky. it would be nice if core would support customizing the path for this (and other) editor files and directories (like theme.json).
Closing for now. Poet by @Log1x supports registering patterns with Blade