Jump to content
E-Luminate

Change default category view to list instead of Grid?

Recommended Posts

Hi,

I'm using the Galaxy X skin with Cubecart 6.18.

Can anyone help me in changing the default product display within categories from grid to list?

Thanks in advance.

Neil.

Share this post


Link to post
Share on other sites

Are you not getting any help from the developer? I hate to say it, but if not - you might do well to consider a better supported skin.

Share this post


Link to post
Share on other sites

Nope, not a whisper.

I've done too much to the skin so far to change. Plus I'm got a strict timescale to get everything done.

I actually thought this request would be an easy one.

Share this post


Link to post
Share on other sites

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.

 

Share this post


Link to post
Share on other sites

Show us what that section of your content.category.php looks like. Maybe we'll be able to help..

It's a shame when a developer abandons their customer base, but it happens to all of us if we stick around long enough.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Try backing up the content.category file and copy in the file from the foundation skin.

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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!

Share this post


Link to post
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.)

Share this post


Link to post
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...