A
A
Andrey Okhotnikov2019-01-15 13:35:12
HTML
Andrey Okhotnikov, 2019-01-15 13:35:12

How to remove block from Layout Magento 2?

Need to redefine some default theme blocks. The topic has a search

<referenceContainer name="header-wrapper">
            <block class="Magento\Framework\View\Element\Template" name="top.search" as="topSearch" template="Magento_Search::form.mini.phtml" />
        </referenceContainer>

I want to remove the top.search block and install my own instead. I do this in my thread
<referenceContainer name="header-wrapper">
            <referenceBlock name="top.search" remove="true"/>
            <block class="Magento\Framework\View\Element\Template" name="customtext" template="Magento_Search::customtext.phtml" />
        </referenceContainer>

Does not work.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question