4

I've been searching for a while and I am only finding answers DevDocs that tell me that in order to modify the column layout for the search results page is to change the xml found in app/design/frontend/<Vendor>/<theme>/Magento_CatalogSearch/layout/ My problem is that my folder structure for my theme does not have a layout folder. Seems like remember seeing the layout setting in the backend config somewhere, but cannot seem to find it there either.

Any search that I perform on my website is resulting in a 4-column layout and I only want a 1-column layout or maybe 2-column with left sidebar. ...all the same for advanced search.

I am using Magento 2.1.4.

2
  • 1
    Overwrite magento\vendor\magento\module-catalog-search\view\frontend\layout\catalogsearch_result_index.xml & Change layout="2columns-left" to layout="1column"
    – Jackson
    Apr 24, 2017 at 3:30
  • @AnkitShah Never overwrite files in /vendor folder!
    – srokatonie
    Feb 17, 2020 at 13:09

1 Answer 1

3

In your theme create the catalogsearch_result_index.xml in following path: app/design/frontend/<Vendor>/<your_theme>/Magento_CatalogSearch/layout/catalogsearch_result_index.xml

Add the below content to xml file.

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <title>Advanced Search</title>
    </head>
</page>

This way you can set column layout for search result page.

EDIT:

If need 1 column layout, need to change in

layout="2columns-left"

to

layout="1column"
1
  • This solution worked as well. I believe that I have another issue that is causing the width of the content section to be reduced below 100%. Thanks for the help!
    – ctroyp
    Apr 24, 2017 at 22:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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