Skip to content
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

Add theme support for block template-parts #675

Merged
merged 1 commit into from
Feb 16, 2024

Conversation

crftwrk
Copy link
Member

@crftwrk crftwrk commented Jan 30, 2024

This PR allows to use blocks as template parts. In Backend Appearance > Template Parts can now the mini-cart edited in more detail and we can hard code it in the theme like woocommerce/storefront#2100.

Think in the long-term, our offcanvas-cart should be replaced by the mini-cart block #631.

Did roughly some changes to demonstrate how it works:

  • Go to https://dev.bootscore.me/shop/ and add something to the cart
  • Scroll down to the footer, there you will find the Woo mini-cart block. Open cart and check buttons, they have classes btn btn-primary etc.

@justinkruit IYLIMI

@justinkruit
Copy link
Member

Personally, not the biggest fan of the block changes. This because it feels like giving over control to WooCommerce which has a bigger tendency to break stuff (see the alerts recently).

I'm also just seeing the block template parts system for the first time, and not entirely convinced. Will we be taking steps back from coding? Because Gutenberg has limited coding options in our current setup, which we can't really change unless we want to change how the theme works (making blocks with NPM compiling).

@crftwrk
Copy link
Member Author

crftwrk commented Feb 5, 2024

Will we be taking steps back from coding? Because Gutenberg has limited coding options in our current setup, which we can't really change unless we want to change how the theme works (making blocks with NPM compiling).

No, I do not mean to create a block theme, I like it as it is. But I think that the entire WP goes more and more to blocks and we have to find a way to be prepared. If for example Woo will remove the cart fragments entirely in future, we need an alternative for our mini-cart. This PR gives us the option to play around with it and maybe the mini-cart block can replace our one by hard coding it to the theme. This PR just allow us to edit blocks in more details and use them as template-parts, nothing more.

@justinkruit
Copy link
Member

Sorry for taking so long, been busy.

Alright, I agree we can and should look into this. But do we want to enable this for this upcoming release? Or wait to expand on this on the release after that?

@crftwrk
Copy link
Member Author

crftwrk commented Feb 15, 2024

This has no effect to the theme but gives us more freedom to play around with blocks. Should be merged as soon as possible.

Copy link
Member

@justinkruit justinkruit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, then lets add it to the theme and see where we go from there 👍

@justinkruit justinkruit merged commit dd6a04a into main Feb 16, 2024
@justinkruit justinkruit deleted the Add-theme-support-block-template-parts branch February 16, 2024 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants