Display conditions in html block
EM
I saw that many people have already written about this option but I will explain it as I thought of it. I came up with this idea after having to edit the products one by one to add a row I needed before the footer using Extra Content block. I could have solved it by creating a custom product layout but I didn't want to remount everything, unfortunately not the prefooter because I wanted the block to be only in the products.
I could have accomplished it with a couple of clicks if in the html block I could set where the block should be displayed like the layouts conditions which are very convenient. In the conditions it would also be useful to have the position as in “Extra Content Position”.
Another idea: in the theme options it is possible to add an html block before and after the add to cart button or using tabs (however so the content is hidden), but it could also be useful to have a hook after the header (e.g. to add a banner) and before the footer (e.g. to add an external review band). The idea of display conditions in html block remains better because allows to set custom content according to brand, categories, specific products and so on instead of being universal but maybe it's more difficult to achieve compared to those hooks in theme options.
E
Enzo Valvasori
YesYes, i already request it. Thank you to do it again !
To be able to put html code conditionally, i made an automation on n8n.
I wanted to add all my shortcodes on product page template.
And show these shortcodes when they match to there the product tags.
If you want to see why it's useful to show shortcode of HTML Blocks conditionall, see the picture
EM
Enzo Valvasori I hope they will consider it, it would be seriously amazing!
Leonardo Defáveri
Oh yes, this is very useful when there is no personalized layout. I had to access 200 products one by one to add a block that would be identical to everyone. It was really easier to create a layout for the category, but around 100 products should not use this block, so I would have to create two layouts maybe.
EM
Leonardo Defáveri exactly, I'm not using layout for product in some clients websites and that's why I had to it manually as you. Having display conditions in html blocks would be awesome or also some new hooks in product pages are still something.