---
title: "link"

doc_type: static
doc_category: static
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/sline/object/link'
  md: 'https://developer.shopline.com/docs/sline/object/link.md'
---

# link


    A link in a [navigation menu](https://help.shopline.com/hc/articles/4402190682137-%E8%8F%9C%E5%8D%95%E5%AF%BC%E8%88%AA%E8%AE%BE%E5%AE%9A).

    



## Properties

    <div>
    

        
<ObjectProperty 
    name="active"
    types={[<Mdx>boolean</Mdx>]}
>
<ObjectSummary>
Whether the link is active.
- `true`: Active
- `false`: Inactive

A link is considered active if the current URL path matches or contains the link's path. For example, if the current URL path is `/blog/tag/cutlery`, links pointing to the following paths will be active:
- `/blog/tag/cutlery`
- `/blog/tag`

> **Tip**
>
> The `link.active` property is especially useful for implementing active states in navigation menus. For example, when a customer is browsing an article from the "Cutlery" blog, the "Cutlery" link becomes active and is highlighted in the menu.
</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="child_active"
    types={[<Mdx>boolean</Mdx>]}
>
<ObjectSummary>
Whether a child link of the link is active.
- `true`: Active
- `false`: Inactive

For example, when the current URL path is `/blog/tag/cutlery`, the `child_active` property of the parent link `/blog/tag/` is `true`.


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="child_current"
    types={[<Mdx>boolean</Mdx>]}
>
<ObjectSummary>
Whether the link has a child link pointing to the current URL path.
- `true`: The link has a child link pointing to the current URL path.
- `false`: The link has no child link pointing to the current URL path.

> **TIP**
>
> Query parameters (the part after the `?` in the URL) are ignored during URL matching.
</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="current"
    types={[<Mdx>boolean</Mdx>]}
>
<ObjectSummary>
Whether the link points to the current URL path.
- `true`: Points to the current URL path.
- `false`: Does not point to the current URL path.

> **TIP**
>
> Query parameters (the part after the `?` in the URL) are ignored during URL matching.
</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="handle"
    types={[<Mdx>string</Mdx>]}
>
<ObjectSummary>
The [handle](https://developer.shopline.com/docs/sline/basics.md#kRuFt) of the link.


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


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="links"
    types={[<Mdx>array of [link](https://developer.shopline.com/docs/sline/object/link.md)</Mdx>]}
>
<ObjectSummary>
A list of the link's child links.


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="title"
    types={[<Mdx>string</Mdx>]}
>
<ObjectSummary>
The title of the link.


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="type"
    types={[<Mdx>string</Mdx>]}
>
<ObjectSummary>
The type of the link. Valid values are:

- `article_link`: The link points to an article.
- `blog_link`: The link points to a blog.
- `catalog_link`: The link points to the catalog of all products.
- `collection_link`: The link points to a product collection.
- `collections_link`: The link points to a list of [product collections](https://help.shopline.com/hc/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 points to the homepage.
- `http_link`: The link points to an external webpage.
- `page_link`: The link points to a [custom page](https://help.shopline.com/hc/articles/900005248563-%E8%87%AA%E5%AE%9A%E4%B9%89%E9%A1%B5%E9%9D%A2).
- `policy_link`: The link points to a [policy page](https://help.shopline.com/hc/articles/4406084105369-%E6%B7%BB%E5%8A%A0%E5%95%86%E5%BA%97%E6%94%BF%E7%AD%96).
- `product_link`: The link points to a product page.
- `search_link`: The link points to the search page.
</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="url"
    types={[<Mdx>string</Mdx>]}
>
<ObjectSummary>
The URL of the link.


</ObjectSummary>
</ObjectProperty>
        
    
    </div>


