You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
If we put image-related blocks in and save them, they lose their link with the part template. #448
I believe what is happening in this scenario is this:
Because an image is in the template the content is converted to a PATTERN so that PHP referencing the image stored in the theme resources folder can be used.
The template that (in this case, and probably in most cases) that is converted contains a reference to a header TEMPLATE PART. This issue in Gutenberg outlines in what way that is problematic, however this change addresses that. So far this is only in Gutenberg though as this change hasn't yet made its way to CORE.
Therefore the solution to this scenario is to EITHER:
Move the reference to the Header Template Part out of the resulting PATTERN and into the TEMPLATE.
OR
Install Gutenberg plugin with this change (which I don't believe has been included in a released version yet).
OR
Move the content of the HEADER Template Part into a PATTERN and reference THAT from the resulting pattern created by Create Block Theme
I don't believe that this is a failing of Create Block Theme.
NOTE: It might also be seen as a solution to include the 'theme' attribute on the Template Part block that is in the generated pattern. Indeed this WOULD make the content render. HOWEVER (as the linked issue details) this is NOT a valid solution if the theme is expected to be used in any environment other than where it was created. The 'theme' attribute MUST match the folder structure the theme is located in and this is not a guaranteed location.
Activity
pbking commentedon Aug 29, 2023
I believe what is happening in this scenario is this:
This issue in Gutenberg outlines in what way that is problematic, however this change addresses that. So far this is only in Gutenberg though as this change hasn't yet made its way to CORE.
Therefore the solution to this scenario is to EITHER:
OR
OR
I don't believe that this is a failing of Create Block Theme.
NOTE: It might also be seen as a solution to include the 'theme' attribute on the Template Part block that is in the generated pattern. Indeed this WOULD make the content render. HOWEVER (as the linked issue details) this is NOT a valid solution if the theme is expected to be used in any environment other than where it was created. The 'theme' attribute MUST match the folder structure the theme is located in and this is not a guaranteed location.
megane9988 commentedon Aug 30, 2023
@pbking
Thank you!!
I have confirmed that the issue no longer occurs when using the Gutenburg plugin (16.5.1)!
Do you want to leave this issue open until the main unit is fixed? Or is it better to close at this timing?
pbking commentedon Sep 6, 2023
I believe we should close this as it isn't actually a problem with CBT.
Thank you for confirming.