Ad

Shopify: Displaying A List Of All Collections On Collection Page

- 1 answer

I'm trying to make a clickable list of all collections on my collection page, but for some reason the following isn't working?

{% for collection in collections %}
    {% collection.title %}
{% endfor %}
Ad

Answer

You can output a variable with double curly braces, like this: {{ collection.title }}

This snippet would give you a list of collections with links:

<ul>
{% for collection in collections %}
  <li>{{ collection.title | link_to: collection.url }}</li>
{% endfor %}
</ul>

You can learn more about Liquid syntax here: https://shopify.github.io/liquid/basics/introduction/

Ad
source: stackoverflow.com
Ad