Jump to content

List view by default


Recommended Posts

i think that it's a bit more complicated ;) because if we change bindgrid function to display "list", if we change product list to grid - website will not "remember" this change and after page reload we will see list again.

 

we have to modify default value of 'dispaly' cookie created with totalStorage jquery plugin

Link to comment
Share on other sites

finally i analysed code a little and 

change:

        var view = $.totalStorage('display');
	if (view && view != 'grid')
		display(view);
	else
		$('.display').find('li#grid').addClass('selected'); 

to:

	var view = $.totalStorage('display');
	if (view && view != 'list')
	    display(view);
	else {
	    $('.display').find('li#list').addClass('selected');
            display("list");
    }

in: themes/default-bootstrap\js\global.js

 

then go to themes/default-bootstrap/product-list.tpl and change:

<ul{if isset($id) && $id} id="{$id}"{/if} class="product_list grid row{if isset($class) && $class} {$class}{/if}{if isset($active) && $active == 1} active{/if}">

to:

<ul{if isset($id) && $id} id="{$id}"{/if} class="product_list list row{if isset($class) && $class} {$class}{/if}{if isset($active) && $active == 1} active{/if}">
  • Like 6
Link to comment
Share on other sites

  • 9 months later...

Hello, moderators and members!

I want to setup 'grid' view by default. That means any time we reload page.

As I understood it is possible to make changes in products-list.tpl and global.js files to setup view (list or grid) when page is released. But, there is another way to set initial view by default, right? 

I mean to modify default value of 'display'. So please help me to  

 

 

modify default value of 'dispaly' cookie created with totalStorage jquery plugin   
Edited by dminch (see edit history)
Link to comment
Share on other sites

  • 7 months later...

Sorry to drag this old thread up - but I've followed the instructions to the letter and I get the nice view without the description but the products still list in Grid by default. 

 

 

As can be seen: http://www.sje-tools.com

 

As the titles of the Carbide inserts page go into the dots (...) because they are too long it's something of a pain - particularly when I sell sets and individuals which you can't distinguish between in grid format.

 

My global.js bindgrid function looks like this:

 

function bindGrid()
{
	var view = $.totalStorage('display');

	if (!view && (typeof displayList != 'undefined') && displayList)
		view = 'list';

	if (view && view != 'list')
		display(view);
	else
		$('.display').find('li#grid').addClass('selected');

	$(document).on('click', '#grid', function(e){
		e.preventDefault();
		display('grid');
	});

	$(document).on('click', '#list', function(e){
		e.preventDefault();
		display('list');
	});
}

I've done all the Cache clearing etc both browser/smarty and my ISP cache (I disabled all these whilst doing the build of the site and things updated as I changed things - so I know it's not a cache thing . . .

 

Cheers

 

Steve

Link to comment
Share on other sites

  • 11 months later...
  • 2 weeks later...

Hello

 

i switched to list view and it is working perfect but i would like to keep it on small  devices like phones and tablets in portrait view (@media (max-width: 767px) and @media (min-width: 768px) and (max-width: 991px) in grid view. Is this possible?

 

best regards 

Link to comment
Share on other sites

  • 4 months later...
  • 7 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...