When my custom product type displays, I want a whole new layout/view. I have the content area being removed by nothing shows when I add it back. Can someone tell me what I'm doing wrong?

<referenceContainer name="content" remove="true" />
<referenceContainer name="content">
    <block class="Magento\Framework\View\Element\Template" name="customproductform" template="CustomProductForm::customproductform.phtml"></block>

it won't work in the way you are doing it.
Once you set remove="true" on a container (or block) that container (or block) will be ignored.
remove doesn't work like a reset button. once you set it, you can start over. It stays in there forever.
You will have to remove all blocks from the container otherwise. unfortunately I don't know yet how to do that.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.