Developer forum

Forum » Rapido » Show more than 4 products on a row

Show more than 4 products on a row

Hans Ravnsfjall
Reply

Hi

 

As it is now, it is only possible to show up to 4 products on a row. How can I show eg. 6 products on a row? Is there some modification to ProductListRender.cshtml or ProductListNoPagination.cshtml that will fix this?

 

I have tried altering @GetProductList(GetLoop("Products"), 3) to @GetProductList(GetLoop("Products"), 6) without any luck.

 

regards Hans


Replies

 
Karsten Thuen
Reply

Hi Hans

As of now the productlist only support up to 4 products. To implement it, requires a little work. In the productlist, start by doing what you did:

@GetProductList(GetLoop("Products"), 6)

 

Open the file "_wrap/Wrapmethods.cshtml" in the DwSimple folder. Add the following in the "ColumnMaker" switch case:

case 6:
     Columns = "col-"+ScreenSize+"-2";
break;

 

As the productlist is a bit more complicated, than just showing products in columns, we will have to do one more adjustment. Open the file "js/ProductListViews.js" in the DwSimple folder (In older versions of Wrap, this is located directly in the Productlist). Then look at the code:

function BoxView() {
    var arr = new Array();
    arr = document.getElementsByClassName("productlist");
    
    for(var i = 0; i < arr.length; i++)
    {
        arr.item(i).className = "productlist col-md-
2 col-sm-2 col-xs-12";
    }

 

In the code part, as shown above, replace 4 with 2. This makes the switching between columns and listviews work for the end user.

 

You must be logged in to post in the forum