How to change the minimum height of one featured product block?
-
I am trying to change the minimum height of individual featured product blocks.
I do not want to change the default minimum height for all featured product blocks, but for one-off individual blocks, preferably using the block markup.I want to be able to use the drag handle to reduce the size so that I can place three products in a column, where the left column has one large product, and the right column has two products that fill the height of the left product.
Right now, I can only do that if I manually change the height of the left product to 1000px, which is too large for my design.
I looked at the source on https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/trunk/src/BlockTypes/FeaturedProduct.php#L22
But if I add block markup like this to my HTML template (full site editing), the minimum height setting is removed from the block editor:
<!-- wp:woocommerce/featured-product {"minHeight":150,"editMode":false,"productId":442,"showDesc":false,"showPrice":false} --> <!-- wp:buttons --> <div class="wp-block-buttons"><!-- wp:button {"align":"center"} --> <div class="wp-block-button aligncenter"><a class="wp-block-button__link" href="https://advanced.local/product/belt/">Shop now</a></div> <!-- /wp:button --></div> <!-- /wp:buttons --> <!-- /wp:woocommerce/featured-product --> <!-- wp:woocommerce/featured-product /-->
They key part that does not work for me is
"minHeight":150
,Pinging @sunyatasattva since you recently worked on the block.
Let me know if I need to open a bug or feature request or something on the GitHub repo instead of a support question.Note that I am using WooCommerce Version 6.4.1, not the development version.
- The topic ‘How to change the minimum height of one featured product block?’ is closed to new replies.