Jump to content

Change default category view to list instead of Grid?


Recommended Posts

Mine does seem to default to list view. If you do a file compare on your skins/skinname/content.category.php file with the one in the foundation skin then you might get an idea of what you need to edit. Alternatively you could back up your original file and copy the one from foundation to see if that works.

 

Link to comment
Share on other sites

Hi,

I've changed the content.category.php to what I thought would swap the default to what I want, I deleted all cookies afterward too (as there is a product cookie). I still get Grid view as standard here is the code before:

   <div class="medium-4 columns show-for-medium-up">
      <dl class="sub-nav right" id="layout_toggle">
         <dd class="active"><a href="#" class="grid_view"><i class="fa fa-th-large"></i></a></dd>
         <dd><a href="#" class="list_view"><i class="fa fa-th-list"></i></a></dd>
      </dl>
   </div>

And this is what I changed it to:

   <div class="medium-4 columns show-for-medium-up">
      <dl class="sub-nav right" id="layout_toggle">
         <dd><a href="#" class="grid_view"><i class="fa fa-th-large"></i></a></dd>
         <dd class="active"><a href="#" class="list_view"><i class="fa fa-th-list"></i></a></dd>
      </dl>
   </div>

There doesn't seem to be any further mention of "list_view" anywhere else in the document.

Link to comment
Share on other sites

I took out the line of code, just as you did @E-Luminate. It worked for me on a Foundation skin:

<div class="medium-4 columns show-for-medium-up">
      <dl class="sub-nav right" id="layout_toggle">
  <!--       <dd><a href="#" class="grid_view"><svg class="icon"><use xlink:href="#icon-th-large"></use></svg></a></dd> -->
      <dd class="active"><a href="#" class="list_view"><svg class="icon"><use xlink:href="#icon-th-list"></use></svg></a></dd>
      </dl>
   </div>

Of course Foundation has svg icons, and you have the FontAwesome icons in the list view.

Link to comment
Share on other sites

I think that code just sets the button to active, dont think it makes the layout change. I tried changing that last night myself and it didn't change the layout at all. Below that there appears to be two blocks of code one for the list view and one for the grid view. I think these might be the other way around in the Galaxy skin (hard to tell not having a copy). Maybe using the code from an appropriate foundation skin might be worth trying. The foundation skin on the cubecart demo defaults to list view whereas the Galaxy demo defaults to grid view.

Link to comment
Share on other sites

Thanks for the suggestions guys. Have been looking at the code for a while and don't see how it outputs the grid format as standard, maybe something I'll look at later down the line maybe. Unless of course somebody else comes along with the same request!

Link to comment
Share on other sites

If the skin is Foundation, then the javascript code controls the initial (default) view. Other skins may or may not use the same approach.

https://forums.cubecart.com/topic/51108-resolved-grid-view-only-disable-list-view-on-categories/

https://forums.cubecart.com/topic/49704-how-to-make-category-grid-view-as-default/

See the above conversations for ideas.

(Even if I have a copy of Galaxy X, I can't access it right now.)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...