In Magento 2, you can suppress the display of a block using the remove
tag
<referenceBlock name="product.info.media.image" remove="true"/>
However, this doesn't remove the block from the layout completely. If you tried to insert a new block with the name product.info.media.image
, you'd get the following error
main.CRITICAL: exception 'Magento\Framework\Exception\LocalizedException' with message 'Element with ID 'product.info.media' already exists.' in /path/to/magento/framework/Data/Structure.php:151
Is there a way -- similar to Magento 1's unsetChild
-- to completely remove a block.
Asking because many Magento 1 extension remove and reinsert blocks, and having a way to do this in Magento 2 would help with automated conversion tools.