Legend Tim, thanks for clearing that up for me. Many Thanks!
Topic summary
A developer created a Metaobject called “brands” containing title, description, image, and a collection reference field. They needed to output the collection handle (not the ID) for use in an href attribute.
Problem:
- The code only returned the collection ID or the full GID format (e.g.,
gid://shopify/Collection/628469498189) - Direct access via
{{ brand.collection }}didn’t provide the handle
Solution provided:
- Use
.valueto access the full collection object from the collection reference field - Example:
{{ brand.collection.value.url }}outputs/collections/all - The
.valueproperty fetches the corresponding collection object and its properties
Key technical detail:
Collection reference fields store only the ID, requiring .value to retrieve the actual collection object with accessible properties like URL and handle. The issue was resolved successfully.