Forums/Vanity Theme

Showing 3 columns instead of 4 in the gallery (collection and home page)

Shopify Concierge
posted this on October 27, 2010 15:10

I was asked via chat how to do show 3 columns in the gallery instead of 4, so here are the steps:

1. Change gallery.liquid

Open gallery.liquid (Theme > Template Editor in the Snippets section).

You'll see an if test at the top. Change it to:

{% if true or template == 'collection.sidebar' %}

This changes it to always assume a 3-col layout.

Now, change the image size from 'compact' to 'medium':

<img src="{{ product.images.first | product_img_url: 'medium' }}" alt="{{ product.title | strip_html | escape }}"/>

2. CSS Changes

Open styles.css.liquid and at the bottom add the following CSS (this will override the existing rules defined further up in the file):


/* 3 col gallery */
#products .product {padding:0 15px; width:300px;}
#products .image {height:288px; width:288px;}
#products .first_col {padding-left: 0;}
#products .last_col {padding-right: 0;}

That's it!

 

Comments

User photo
hillary anderson

thanks for the above.

is there also a way to choose the number of products per page to multiples of 3?  after making this change, on the theme settings page, the pull down for the number of products per page still reads 8, 12, 16 . . . {so only 12 makes even columns}

 

January 03, 2012 10:45.
User photo
Shopify Concierge
Shopify Concierge

Ah, yes - I forgot about that.

Open settings.html and search for "collection_products". Change the options there. It should be around line 366.

January 03, 2012 10:50.
User photo
MJQ

I updated that in the collections and it didn't change anything in the store...

February 17, 2012 09:16.