0

How do I display product search results in a single column? Essentially I want to default it to a list view all the time. Would I need to make a controller to append the query variable to the URL?

Sample

2

To set default list mode for search result page, you can copy catalogsearch_result_index.xml

from:

vendor\magento\module-catalog-search\view\frontend\layout 

to:

app\design\frontend\Your_Vendor_Name\Your_Theme_Name\Magento_CatalogSearch\layout

add this code:

<arguments>
    <argument name="_current_grid_mode" xsi:type="string">list</argument>
</arguments>

into block name: product_list_toolbar

| improve this answer | |
1

To be precise, add below code to layout of the module:

<referenceBlock name="product_list_toolbar">
    <arguments>
        <argument name="_current_grid_mode" xsi:type="string">list</argument>
    </arguments>
</referenceBlock>
| improve this answer | |

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.