Adding "All Collections" to collection list options

Hi All,

Shopify 2.0, dawn, trying to add a option for “All Collections” in the collections list. It only allows to list a specific collection whereas I would like a selection where all collections show up. I assume code has to be added to the collection-list-liquid file but could some help. Something along the lines of: if collection field is left blank, default to “all collections”

Any help is appreciated.

RP

@rpaulpen Hey, thanks for posting here.

can you please use this method:

{% assign selected_collections = section.settings.collections %}

{% if selected_collections.size > 0 %}
  
  {% for collection in selected_collections %}
    
      
        
        ### {{ collection.title }}
      
    

  {% endfor %}
{% else %}
  
  {% for collection in collections %}
    
      
        
        ### {{ collection.title }}
      
    

  {% endfor %}
{% endif %}

Thank you for your reply. Not quite what I was thinking. This loads all the collections if left blank wheres what I want is the normal collection list but the one left blank should have a link to the “all collections” rather than a specific collection.

Looking at this closer, the code seems to be in card-collection.liquid. Maybe my description is not clear. All I want in the collection card is to be able to select “All collections” instead of a specific collection. Looking at the attached image, it would take user to same place as the “View All” button does. Assuming the easiest way would be to default to “view all” if left blank.

@rpaulpen does not understand it.