setting grid view as default
6 posts
• Page 1 of 1
setting grid view as default
I am using the default theme for opencart. I have grid size set to how I want it but I am trying to set the grad view a the default. The code I have tried to change to get it to work is below. But it did not work when I open it in another browser so it is not loading from the admin panel it shows as a list view.
Can anyone help me with this?
This is the code I changed in the catalog/view/theme/default/template/product/category.tpl file
<div class="display"><b><?php echo $text_display; ?></b> <?php echo $text_list; ?> <b>/</b> <a onclick="display('grid');"><?php echo $text_grid; ?></a></div>
I changed it to this but it did no good.
<div class="display"><b><?php echo $text_display; ?></b> <?php echo $text_grid; ?> <b>/</b> <a onclick="display('list');"><?php echo $text_list; ?></a></div>
Can anyone help me with this?
- DnAWebCreations
- Posts: 17
- Joined: Sun Feb 12, 2012 10:52 pm
Re: setting grid view as default
Thanks a lot, as best I can tell it is working great.
- DnAWebCreations
- Posts: 17
- Joined: Sun Feb 12, 2012 10:52 pm
Re: setting grid view as default
Hi,
im using version 1.5.1.3 and the following has worked for me.
Try the following in category.tpl. Change the last line : display('list'); to display('grid');
view = $.cookie('display');
if (view) {
display(view);
} else {
display('grid');
my website is http://www.callaghancandles.ie
im using version 1.5.1.3 and the following has worked for me.
Try the following in category.tpl. Change the last line : display('list'); to display('grid');
view = $.cookie('display');
if (view) {
display(view);
} else {
display('grid');
my website is http://www.callaghancandles.ie
- callaghand
- Posts: 1
- Joined: Tue Mar 13, 2012 9:45 pm
Re: setting grid view as default
callaghand wrote:Hi,
im using version 1.5.1.3 and the following has worked for me.
Try the following in category.tpl. Change the last line : display('list'); to display('grid');
view = $.cookie('display');
if (view) {
display(view);
} else {
display('grid');
my website is http://www.callaghancandles.ie
When you update do you have to go back in and change the code to have the default as a grid? I had it working with the first way I tried but after update it is back to list view.
- DnAWebCreations
- Posts: 17
- Joined: Sun Feb 12, 2012 10:52 pm
Re: setting grid view as default
DnAWebCreations wrote:When you update do you have to go back in and change the code to have the default as a grid? I had it working with the first way I tried but after update it is back to list view.
Depends on what theme ou are using. If you are using the default open cart theme, then yes as the upgrade will have overwritten the previous version of the file.
If you are using a custom file, then in this particular instance, probably not as you custom file will not ave been overridden. Then again, if you are using a custom theme, then you might have other problem as you need to upgrade your custom file.
Have a look at your file, is the change you made still there ?
- jty
- Posts: 1163
- Joined: Sat Aug 30, 2008 12:19 am
6 posts
• Page 1 of 1
Return to Installation, Upgrade, & Config Support
Who is online
Users browsing this forum: No registered users and 12 guests














