But no collection is retrieving using this method. childlink.object.id is giving me correct collection id but still can’t getting properties of the collection in navigation.liquid file.
Help me to resolve this issue. If you have any other method to retrieve collection using collecti
I do not think collections with S have an object id. However, you can probably try the following code below to call the collection with an ID. See more information here.
I am curious if there is such variable childlink.object.id, never seen it before
{% for collection in collections %}
{%- assign collection = collections[childlink.object.id] %}
{% endfor %}
Please don’t forget to Like and Mark Solution to the post that helped you. Thanks!
To get an object by an arbitrary id you have to either just loop over all that objects of that type and do a property match, or try to filter it down with array filters:
UNTESTED “collections” is an object not an array so may fail, and off the top of my head don’t remember how this interacts with more than 50 collections