Dual Layouts

Highlighted
New Member
5 0 0
Hey Everyone, I was wondering if its possible to setup a shop to use two templates at the same time. I am setting up a site for a clothing store and we want to have separate templates for the guys section, and the girls section; without having to manage two separate accounts. Is something like this possible? If so does anyone have an idea of how I would go about setting something like this up? Thanks in advance. -Edward
0 Likes
Highlighted
Shopify Partner
484 0 2

This is definitely possible. You’ll have to be a little savy with liquid though.

Somthing like the following in your collection.liquid template could do the trick:

{% case collection.handle %}
    {% when "guys" %}
        guys layout...
    {% when "girls" %}
        girls layout...
    {% else %}
        other collections...
{% endcase %}
Jared Burns, CEO at Getsy (http://get.sy)
0 Likes
Highlighted
Excursionist
1027 0 9

You could use one theme with two different style sheets. Then in the head section of your theme.liquid


{{ 'shop.css' | asset_url | style_sheet }}

{% if page_title contains 'mens' %}

 {{ 'mens.css' | asset_url | style_sheet }}

{% endif %}
{% if page_title contains 'womens' %}

 {{ 'womens.css' | asset_url | style_sheet }}

{% endif %}

Then when you create products, collections, or pages, make sure that the keywords mens, or womens is in the page title.

What this will do is load the default shop.css stylesheet, and if the page title contains either of the keywords, it will load that stylesheet and override the shop.css stylesheet elements since it is declared after the default one.

You will have to know your css and it is involved. This is just the basic concept.

Dan - http://www.xtremechargers.com
0 Likes
Highlighted
New Member
5 0 0

Thanks guys! The forum didn’t notify my of your posts so I didn’t remember to check back.

There are some good tips here, thank you!

0 Likes