As far as I can tell Magento2 is not working as expected here.
In /Magento_CatalogSearch/layout/
I have 4 XML files:
catalogsearch_advanced_index.xml
catalogsearch_advanced_results.xml
catalogsearch_result_index.xml
default.xml
In the top of each of these files I have the following line:
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
Notice it says layout="1column"
. I have cleared caches, I have re-indexed.
Despite all of this my search results page is still using 2columns-left
.
My search results page is using 2columns-left
as its template file. How do I change this so my search results page is using 1column
?
Here is the full contents of catalogsearch_result_index.xml
:
<?xml version="1.0"?>
<!--
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<attribute name="class" value="page-products"/>
<referenceContainer name="content">
<block class="Magento\CatalogSearch\Block\Result" name="search.result" template="result.phtml" cacheable="false">
<block class="Magento\CatalogSearch\Block\SearchResult\ListProduct" name="search_result_list" template="product/list.phtml" cacheable="false">
<arguments>
<!-- If argument's position depends on image size changeable in VDE:
positions:list-secondary,grid-secondary,list-actions,grid-actions,list-primary,grid-primary
-->
<argument name="positioned" xsi:type="string">positions:list-secondary</argument>
</arguments>
<block class="Magento\Catalog\Block\Product\ProductList\Toolbar" name="product_list_toolbar" template="product/list/toolbar.phtml" cacheable="false">
<block class="Magento\Theme\Block\Html\Pager" name="product_list_toolbar_pager" cacheable="false"/>
</block>
<action method="setToolbarBlockName">
<argument name="name" xsi:type="string">product_list_toolbar</argument>
</action>
<block class="Magento\Framework\View\Element\RendererList" name="category.product.type.details.renderers" as="details.renderers">
<block class="Magento\Framework\View\Element\Template" as="default"/>
</block>
</block>
<action method="setListOrders"/>
<action method="setListModes"/>
<action method="setListCollection"/>
</block>
</referenceContainer>
</body>
</page>