Shopify themes, liquid, logos, and UX
Hi - I am trying to add some text to a collection page, based on what collection the product is in.
We sell coffee, so if a visitor visits the coffee collection it should show the taste notes on the collection page. If the visitor goes to the equipment collection nothing should show.
I can add the taste notes field in, it just shows on every collection ;(
Thanks
Solved! Go to the solution
This is an accepted solution.
I just want to show one text line under above the price. do I really need to create new collection templates to do that?
@abe2 If there's only a slight difference between the collection pages, then you don't really need to create separate collection templates. Instead, you could use some Liquid control flow tags to show different content based on the collection. For example:
{% if collection.handle == 'coffee' %}
do something
{% endif %}
Docs for reference:
Hopefully this helps!
@abe2 - it is because shopify shares same template files for all collections.
To have different description, you will need to have different templates for different collections. If there are too many collections, then it is not feasible.
Hi, yes, it shared the same collection page. We only have 3 collections in total. Coffee, Coffee Subscriptions and Equipment.
@abe2 - then you need 3 collection templates... each for one category and you can set description for it
Thank you. Just to be clear - everything about the collection pages is fine - I just want to show one text line under above the price.
do I really need to create new collection templates to do that?
This is an accepted solution.
I just want to show one text line under above the price. do I really need to create new collection templates to do that?
@abe2 If there's only a slight difference between the collection pages, then you don't really need to create separate collection templates. Instead, you could use some Liquid control flow tags to show different content based on the collection. For example:
{% if collection.handle == 'coffee' %}
do something
{% endif %}
Docs for reference:
Hopefully this helps!
That’s the one. Thank you! I don’t suppose you have a reference for building different collection page templates?
You're most welcome, @abe2!
Here's a link to Shopify's docs for theme templates: https://shopify.dev/themes/architecture/templates
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024