Search

Index

Revindex Storefront

How to default to list view

By default, the product list displays products arranged in grid view format. In order to change the product list to display in list view by default, you need to:

  1. Create a custom display template from the Storefront's Configuration > Display templates menu.
     
  2. Select the "Product list" module control and Add new.
     
  3. Give the new custom display template a name (e.g. CustomProductList)
     
  4. Always choose the latest Base display template with the highest version number.
     
  5. Look for the following line and add the Selected="True" attribute:
     
    <asp:ListItem resourcekey="ListPageViewModeListItem" Value="List" Selected="True">List</asp:ListItem>
     
  6. Save the display template.
     
  7. Under Configuration > Product list menu, set the Display template to your newly created custom display template.

When in grid view, the HTML includes the CSS class "rvdsfPageViewModeGrid" and when in List view, the CSS class is "rvdsfPageViewModeList". You can use this information to customize the CSS to format the list and grid layout nicely to the way you want.

Comments

jeff Mar 02, 2017 8:45 PM
in storefront 10, standard13 template this line no longer exists.
<asp:ListItem resourcekey="ListPageViewModeListItem" Value="List" Selected="True">List</asp:ListItem>

so  I can't follow these directions to default to list view
jeff Mar 02, 2017 8:53 PM
Never mind, rookie error, I found it.

Powered by Revindex Wiki