-
Notifications
You must be signed in to change notification settings - Fork 219
Add render logic to BlockTemplateController #4984
Add render logic to BlockTemplateController #4984
Conversation
Size Change: +11.3 kB (+1%) Total Size: 1.12 MB
ℹ️ View Unchanged
|
84b718e
to
be458b7
Compare
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.
LGTM, good job @tjcafferkey!
Failing tests are related to these changes. Need to investigate. |
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.
@tjcafferkey LGTM! Just one minor issue then we can merge this PR. Pre-approving! Tested and it worked great on my end.
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.
This works well! The testing instructions should be updated to correctly reflect the precedence of Theme > Blocks > Core though, seems they're swapped in this PR description.
Approving, but not merging due to an outstanding suggestion that you should consider.
@tjcafferkey Testing this PR again, I notice the header and footer didn't load on my test site using the TT1 Block theme. When I edit the single product template in the Site Editor for the first time, I need to choose the template part for the header and footer. |
Using this template I can load the header and footer out of the box
|
Thanks @dinhtungdu, you are right about my template markup. I just never updated it (have it on a clipboard) seeing as I was focusing more on the mechanism of loading the templates rather than the template itself. Thanks for the new markup I'll update so I can use this from now on 😄 |
Co-authored-by: Tung Du <[email protected]>
* Add render logic to BlockTemplatesController * Comment out action to test e2e tests * Add add_action back into initialise render method * Check function exists before using it * Change hook from wp to template_redirect * Update src/BlockTemplatesController.php Co-authored-by: Tung Du <[email protected]> Co-authored-by: Tung Du <[email protected]>
* Add render logic to BlockTemplatesController * Comment out action to test e2e tests * Add add_action back into initialise render method * Check function exists before using it * Change hook from wp to template_redirect * Update src/BlockTemplatesController.php Co-authored-by: Tung Du <[email protected]> Co-authored-by: Tung Du <[email protected]>
Fixes #4971
Testing
Manual Testing
How to test the changes in this Pull Request:
single-product.html
template and refresh your Product Page. Confirm the Woo Blocks template is being rendered./theme-dir/block-templates/single-product.html
/woo-blocks/templates/block-templates/single-product.html
Changelog