-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Use a Template Part in a Pattern without including a theme
attribute.
#53194
Labels
[Feature] Patterns
A collection of blocks that can be synced (previously reusable blocks) or unsynced
[Status] In Progress
Tracking issues with work in progress
[Type] Enhancement
A suggestion for improvement.
Comments
jordesign
added
[Type] Enhancement
A suggestion for improvement.
[Feature] Patterns
A collection of blocks that can be synced (previously reusable blocks) or unsynced
labels
Aug 1, 2023
github-actions
bot
added
the
[Status] In Progress
Tracking issues with work in progress
label
Aug 8, 2023
This still seems to be an issue when using a pattern inside another pattern, so I'm going to reopen it... |
I have another fix here: #54595 |
This was referenced Sep 20, 2023
I think this can be closed again since #54595 is merged. |
github-project-automation
bot
moved this from In Progress
to Done
in Automattic team Ignite's project board
Oct 2, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[Feature] Patterns
A collection of blocks that can be synced (previously reusable blocks) or unsynced
[Status] In Progress
Tracking issues with work in progress
[Type] Enhancement
A suggestion for improvement.
When a template (or template part) includes a template part in the markup the
theme
attribute can be left out. I believe that means that "this theme" is assumed.When building themes it seems to be necessary to make sure that the attribute is NOT present since the full location of the theme has to be included. (For example if a theme is installed in a folder
/themes/pub/my-theme
the attribute MUST bepub/my-theme
, if instead it ismy-theme
or anything else the template part referenced won't be found).However when a theme includes a PATTERN and the PATTERN references a template-part in that theme the template part will ONLY be rendered if the
theme
attribute is included. And since it has been established that when building a theme thetheme
attribute must be excluded the result is that a PATTERN included in the theme CANNOT include any template parts.This is only important in some situations where a pattern has to be used for the content of a template (so that the content can be localized or can reference images included in the theme) and also must include assets such as a header template-part. Work-arounds include ensuring that patterns ONLY include references to other patterns and making sure that templates can achieve their layouts in ways that don't require those references to be made in their content.
What is your proposed solution?
When a template part is loaded from a pattern the
theme
is assumed to bethis theme
just as it is when loaded from a template.The text was updated successfully, but these errors were encountered: