-
Notifications
You must be signed in to change notification settings - Fork 182
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
Block Themes: Remove theme attributes from block templates #172
Conversation
9a0db89
to
ddc4bf4
Compare
ddc4bf4
to
f0047ba
Compare
I'm having a tough time understanding what problem this PR solves or if there might be alternative approaches. It's the problem that when templates are created and then the theme is moved to a subdirectory and reactivated they aren't available in the reactivated theme? |
I'll update the PR description tomorrow to try and make the problem more accessible 👍
That's on the right track. What happens is that when the theme is initially created in or moved to any subdirectory, the template parts defined in theme-provided block templates won't load in the Full Site Editor. The issue will look something like this: ExampleTake the
In a recent Gutenberg PR WordPress/gutenberg#28088, we decided that the best path forward was to remove the static theme attribute provided by block templates theme files. The Gutenberg plugin now handles assignment of the correct theme attribute (see here and here) so that we can guarantee that it will match the current theme's stylesheet. |
I am not able to use the steps listed above for testing. I am not using wp-env. But as far as I can tell the pull request is correct. The confusion lies in the description, the pr is very straight forward and all that was needed was to refer to WordPress/gutenberg#28088 🤷♀️ |
That's a wonderful suggestion! I removed the PR description since it seemed to be causing more confusion than helping and included a reference to #28088 instead. Thank you @carolinan 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR @jeyip.
I just tested this PR against Gutenberg master and the templates + template parts appear correctly in the site editor, even when the theme is nested in a subdirecory.
However using the latest plugin release (9.8.0), the template parts do not resolve correctly.
Could we wait for WordPress/gutenberg#28088 to be included in a release before landing this PR, or is there a reason to ship this PR before then?
This makes sense to me 👍 We can revisit this once Gutenberg v9.9 is released |
Quick update: |
Trying to solve merge conflict.
Sync branch with master
I merged the changes for TT1 Blocks only. |
…ordPress/theme-experiments into update/block-template-theme-attributes
This PR originally updated If not, I can close out this PR. |
Yeah, I think it's fine to close, until we do a more thorough refresh of either of those two themes. Thanks, @jeyip! |
Changes proposed in this Pull Request:
Remove theme attributes from block-theme block templates
Context:
This PR was created as a follow-up to WordPress/gutenberg#28088. See the aforementioned PR description and code changes for more context.
Discussion:
Testing:
.wp-env.override.json
npx wp-env start --update
.wp-env.override.json
npx wp-env start --update