I want to remove the category image and title at the top of the default category product listing page. I have followed the DevDocs page on overriding an XML layout file:
And after flushing the cache, removing generated files from the VAR folder, and rebuilding those, the supposedly modified layout remains unchanged.
I have found conflicting advice online regarding the naming of override files, and have tried them both without success. One says it should be called default.xml while the other says use the same name as the xml file being overridden (this one makes more sense to me).
Is there a step I'm missing in getting the modification to work? Are the steps outlined in the docs wrong?
I have copied this file: vendor\magento\module-catalog\view\frontend\layout\catalog_category_view.xml
And added the following code:
<?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="columns.top" remove="true"/> </body> </page>
I have also tried removing just one of the named blocks to see if the override is working and I am unable to remove the entire container, but no!??
<referenceBlock name="category.image" remove="true"/>
Could someone please tell me what I am doing wrong, or missing?