I am working on a Magento 2.1.7 shop.
On my category pages, I need to have the grid view only, without giving the customer the possibility of switching to the list view.
What is the easiest and/or the most appropriate way to do this?
You can choose the Catalog view option as grid only or list only. The default is Grid/List. You can change it to List/Grid as well.
To do so:
1) Go to Store -> Configuration -> Catalog -> Storefront
2) Change the List Mode.
If needed can be also applied from layout xml
catalog_category_view.xml
<?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="product_list_toolbar"> <action method="disableExpanded"/> </referenceBlock> </body> </page>