How can you add a subheading or text below the title for a Collection List on a the home page?
For example, on my home page I have a collection list titled “curated collections” with three collections below it. I would like to add a sentence (ie a subheading or text) below it with a brief description of the collection list. Is this possible?
This can be done using edit liquid file sections/featured-collection.liquid. Goto this file and see the following screenshot and add that line below the heading and replace your text.
To achieve this you will want to do it like so instead
{% if collection.handle == "shirts" %}
Subtext Shirts here
{% elsif collection.handle == "pants" %}
Subtext Pants here
{% else %}
Subtext Other Collections here
{% endif %}
This will show a subtext for “shirts” & “pants” collection, and then a subtext to all of the other collections. If the collection name has spaces the handle replaces them with dashes eg: long sleeve turns into long-sleeve
Hope this helps and let me know if you need me to go into more detail on how to integrate this for your collections.
I can’t get this to work. Just to make sure we are on the same page, I am talking about Collections Lists features on the home page, not collections.
If this is in fact what you mean, perhaps I am doing something wrong. Should this code be in the same location that @dmwwebartisan mentioned earlier?
Also a bit confused on your spaces comment. My home page has two collections, one titled Curated Collections, and the other titled Shop by Category. Should my code look like this?
{% if collection.handle == "Curated-Collections" %}
Subtext here
{% elseif collection.handle == "Shop-by-Category" %}
Subtext here
{% else %}
{% endif %}
I cannot save this, as I get this error message:
Line 8 — Liquid syntax error: Unknown tag ‘elseif’
I no longer get the error message with your updated code. However, under both of my collections lists it not just says “Subtext Other Collections here” when I put the code like this:
{% if collection.handle == “curated-collections” %}