Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Each collection has a custom.parent_collection metafield of type Collection. I need to display subcollections inside a collection that refer to it through a metafield. If people don’t like the collection, then it’s just a title. But now the problem is, I don’t understand how to compare their handle. Perhaps there is a better way to do this.
<div class="business-categories__items"> {% for parent_collection in collections %} {% if parent_collection.metafields.custom.parent_collection == blank %} <div class="category-item"> <div class="category-item__title"> <p>{{ parent_collection.title }}</p> </div> {% for child_collection in collections %} {% if child_collection.metafields.custom.parent_collection == parent_collection.handle %} <div class="category-item__child-title"> <p>{{ child_collection.title }}</p> </div> {% endif %} {% endfor %} </div> {% endif %} {% endfor %} </div>
We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024The Hydrogen Visual Editor is now available to merchants in Shopify Editions | Summer '...
By JasonH Sep 2, 2024