The link object

The link object cannot be invoked on its own. It must be invoked inside a linklist.

The link object has the following attributes:

Returns true if the link is active, or false if the link is inactive.

If you are on a product page that is collection-aware, link.activewill return true for both the collection-aware product URL and the collection-agnostic URL. For example, if you have a link whose URL points to:

/products/awesome-product will return true for the following URL, which links to the same product but through a collection:


If you are on a collection page filtered with tags, and the link points to the unfiltered collection page, will return true.

If you are on an article page and your link points to the blog, will return true.

Returns the variable associated to the link. The possible types are:

Through link.object, you can access any of the attributes that are available in the above three variables.


<!-- If the product links to a product with a price of $10 -->
{{ link.object.price | money }}



Returns the title of the link.

Returns the type of the link. The possible values are:

  • collection_link: if the link points to a collection
  • product_link: if the link points to a product page
  • page_link: if the link points to a page
  • blog_link: if the link points to a blog
  • relative_link: if the link points to the search page, the home page or /collections/all
  • http_link: if the link points to an external web page, or a type or vendor collection (ex: /collections/types?q=Pants)

Returns the URL of the link.

Want to discuss this page?

Visit the Shopify Community