---
title: "link"

doc_type: static
doc_category: static
doc_version: v20260901
source_url:
  html: 'https://developer.shopline.com/docs/handlebars/objects/link'
  md: 'https://developer.shopline.com/docs/handlebars/objects/link.md'
---
# link

<div class="code-flex">

<div>
  <ObjectSummary>
    [Menu navigation](https://help.shopline.com/hc/zh-cn/articles/4402190682137-%E8%8F%9C%E5%8D%95%E5%AF%BC%E8%88%AA) links.
  </ObjectSummary>

  <ObjectDescription>
    To learn how to implement menu navigation in your theme, refer to [Adding Menu Navigation to Themes](/docsv2/ec20/hgr7vj9rpaah1a6m/6q3qa2gknb3jmh4k).
  </ObjectDescription>

  #### Properties

  <ObjectProperty
    name="active"
    types={['boolean']}
  >
    <ObjectSummary>
      Returns `true` if the link is active. Otherwise, returns `false`.
    </ObjectSummary>
    <ObjectSummary>
      A link is regarded as active if the current URL path matches the link's [URL](https://developer.shopline.com/docs/handlebars/objects/link.md). For instance, if the current URL path is `/blog/tag/cutlery`, the following link URLs would be regarded as active:
        - `/blog/tag/cutlery`
        - `/blog/tag`
    </ObjectSummary>
    <Admonition title="Tip" type="tip">
      The `link.active` property is useful for designing the appearance of the currently selected menu navigation. For instance, if a customer is viewing an article in the "Tag" blog, the "Tag" link would be highlighted in the menu.
    </Admonition>
  </ObjectProperty>

  <ObjectProperty
    name="child_active"
    types={['boolean']}
  >
    <ObjectSummary>
      Returns `true` if the link's child links are active. Otherwise, returns `false`.
    </ObjectSummary>
    <ObjectSummary>
      A link is considered active if the current URL path matches or contains the link's [url](https://developer.shopline.com/docs/handlebars/objects/link.md).
    </ObjectSummary>
    <ObjectSummary>
      For instance, if the current URL path is `/blog/tag/cutlery`, the following link URLs would be regarded as active:
      - `/blog/tag/cutlery`
      - `/blog/tag`
    </ObjectSummary>
  </ObjectProperty>

  <ObjectProperty
    name="child_current"
    types={['boolean']}
  >
    <ObjectSummary>
      Returns `true` if the current URL path aligns with any of the link's child URLs. Otherwise, it returns `false`.
    </ObjectSummary>
    <Admonition title="Note" type="note">
      Ignore parameters when matching URLs. Product URLs within a collection context using the `within` helper are treated the same as standard product URLs.
    </Admonition>
  </ObjectProperty>

  <ObjectProperty
    name="current"
    types={['boolean']}
  >
    <ObjectSummary>
      Returns `true` if the current URL path corresponds to the link's [URL](https://developer.shopline.com/docs/handlebars/objects/link.md). Otherwise, it returns `false`.
    </ObjectSummary>
    <Admonition title="Note" type="note">
      Ignore parameters when matching URLs. Product URLs within a collection context using the `within` helper are treated the same as standard product URLs.
    </Admonition>
  </ObjectProperty>

  <ObjectProperty
    name="handle"
    types={['string']}
  >
    <ObjectSummary>
      The link's [handle](https://developer.shopline.com/docs/handlebars/objects/handle.md).
    </ObjectSummary>
  </ObjectProperty>

  <ObjectProperty
    name="levels"
    types={["number"]}
  >
    <ObjectSummary>
      The quantity of nested levels beneath the link.
    </ObjectSummary>
  </ObjectProperty>

  <ObjectProperty
    name="links"
    types={[<Mdx>array of [link](https://developer.shopline.com/docs/handlebars/objects/link.md)</Mdx>]}
  >
    <ObjectSummary>
      The child links of the link.
    </ObjectSummary>
    <ObjectDescription>
      Example
    </ObjectDescription>
    <ObjectSummary>
      Check the number of links.
    </ObjectSummary>

  </ObjectProperty>

  <ObjectProperty name="title" types={['string']}>
    <ObjectSummary>
      The title of the link.
    </ObjectSummary>
  </ObjectProperty>
  <ObjectProperty name="type" types={['string from a set of values']}>
    <ObjectSummary>
      The type of the link.
    </ObjectSummary>
    <ObjectSummary>
|  Property Value  | Description  |
|------------------|--------------|
| article_link     | The link directs to an article. |
| blog_link        | The link directs to a blog collection. |
| catalog_link     | The link directs to all product collections. |
| collection_link  | The link directs to a product collection. |
| collections_link | The link directs to a collection list page. [Collection list page](https://help.shopline.com/hc/zh-cn/articles/14395898015513-%E5%95%86%E5%93%81%E5%88%86%E7%B1%BB%E7%AE%A1%E7%90%86%E4%B8%8E%E8%AE%BE%E8%AE%A1). |
| frontpage_link   | The link directs to the homepage. |
| http_link        | The link directs to an external webpage. |
| page_link        | The link directs to a [custom page](https://help.shopline.com/hc/zh-cn/articles/900005248563-%E8%87%AA%E5%AE%9A%E4%B9%89%E9%A1%B5%E9%9D%A2). |
| policy_link      | The link directs to a [policy page](https://help.shopline.com/hc/zh-cn/articles/4406084105369-%E6%B7%BB%E5%8A%A0%E5%95%86%E5%BA%97%E6%94%BF%E7%AD%96). |
| product_link     | The link directs to a product page. |
| search_link      | The link directs to a search page. |
    </ObjectSummary>
  </ObjectProperty>


  <ObjectProperty name="url" types={['string']}>
    <ObjectSummary>
      The URL of the link.
    </ObjectSummary>
  </ObjectProperty>
  <br/>
</div>

<div>
  <ObjectAccess
    object="link"
    global={false}
    parents={[
      { object: 'linklist.links', link: '/docsv2/ec20/hdwvcvrgnfcjf4gq/ss29t3x46x3zbgjz#links' }
    ]}
  />
</div>

</div>
