---
layout: default
title: link
nav:
group: Liquid Variables
---
# link
The link object cannot be invoked on its own. It must be invoked inside a linklist.
The link object has the following attributes:
{% table_of_contents %}
{% anchor_link "link.active", "link-active" %}
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:
link.active 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, link.active will return true.
If you are on an article page and your link points to the blog, link.active will return true.
link.object, you can access any of the attributes that are available in the above three variables.
Input
Output
Returns the title of the link.
{% anchor_link "link.type", "link-type" %} 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) {% anchor_link "link.url", "link-url" %}Returns the URL of the link.