Change title of subcollections with metafields

Highlighted
New Member
2 0 0

Right now I have a master collection with the url "/collections/all-products"

I've also have 2 gendered subcollections with the url "/collections/all-products/mens" & "/collections/all-products/womens"

I want the titles to be different for all three versions of the page. I'm using metafields to solve this.

This is what I currently have, for some reason it's not working properly:

    {% if collection.handle contains 'mens' %}
{{ collection.metafields.custom_fields.collection_title_mn }}
    {% if collection.handle contains 'womens' %}
{{ collection.metafields.custom_fields.collection_title_wn }}
    {% else %}
{{ collection.metafields.custom_fields.collection_title }}
        {% endif %}
{% endif %}
0 Likes
Highlighted
Shopify Partner
907 185 212

Hello,

Try this

{% if collection.handle contains 'mens' %}
	{{ collection.metafields.custom_fields.collection_title_mn }}
{% elsif collection.handle contains 'womens' %}
	{{ collection.metafields.custom_fields.collection_title_wn }}
{% else %}
	{{ collection.metafields.custom_fields.collection_title }}
{% endif %}
Want to modify or custom changes on store hire me.
My Email: guleriathakur43@gmail.com
Skype: navrocks1
If helpful then please Like and Accept Solution.
If you are happy and want to donate small Click here (Its my paypal)
0 Likes
Highlighted
New Member
2 0 0

Guleria, the first two settings keep getting skipped over.

The gender-less one is the only one that ever shows.

0 Likes