---
title: "collection"

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

# collection


    A collection in a store.

    > **TIP**
>
> To get the collection's metafields, use the [get_metafields](https://developer.shopline.com/docs/sline/filter/get-metafields.md) filter.



    <div>
    
        #### Properties

        
<ObjectProperty 
    name="all_products_count"
    types={[<Mdx>integer</Mdx>]}
>
<ObjectSummary>
Indicates the total quantity of all products in the product collection. The total count includes items that have been filtered out by the current filter criteria.


> **TIP**
>
> To get the number of products displayed on the current page, namely the actual visible product count after filters are applied, use `collection.products_count`.
</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="all_tags"
    types={[<Mdx>array of string</Mdx>]}
>
<ObjectSummary>
All of the tags applied to the products in the collection.

This includes tags for products that have been filtered out of the current view. A maximum of 1,000 tags can be returned.

> **TIP**
>
> To display the tags that are currently applied, use `collection.tags`.
</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="all_types"
    types={[<Mdx>array of string</Mdx>]}
>
<ObjectSummary>
All of the product types in a collection.


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="all_vendors"
    types={[<Mdx>array of string</Mdx>]}
>
<ObjectSummary>
All of the product vendors in a collection.


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="current_type"
    types={[<Mdx>string</Mdx>]}
>
<ObjectSummary>
The product type on a product type collection page.

You can query for products of a certain type at the `/collections/types` URL with a query parameter in the format of `?q=[type]`, where `[type]` is your desired product type.

> **TIP**
>
> The query value is case-insensitive, so `shirts` is equivalent to `Shirts` or `SHIRTS`.
</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="current_vendor"
    types={[<Mdx>string</Mdx>]}
>
<ObjectSummary>
The vendor name on a vendor collection page.

You can query for products from a certain vendor at the `/collections/vendors` URL with a query parameter in the format of `?q=[vendor]`, where `[vendor]` is your desired product vendor.

> **TIP**
>
> The query value is case-insensitive, so `apparelco` is equivalent to `ApparelCo` or `APPARELCO`.
</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="default_sort_by"
    types={[<Mdx>string</Mdx>]}
>
<ObjectSummary>
The default sort order of the collection.

This is set on the collection's page in the SHOPLINE Admin.


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


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="featured_image"
    types={[<Mdx>[image](https://developer.shopline.com/docs/sline/object/image.md)</Mdx>]}
>
<ObjectSummary>
The featured image for the collection.

The featured image for the collection is used by default. If the image isn't available, the system uses the featured image for the first product in the collection. If the first product in the collection doesn't have a featured image, `null` is returned.


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="filters"
    types={[<Mdx>array of [filter](https://developer.shopline.com/docs/sline/object/filter.md)</Mdx>]}
>
<ObjectSummary>
The storefront filters that have been set up on the collection.

Only filters relevant to the current collection are returned. Filter data will not be returned for collections that contain over 5000 products.


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


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="id"
    types={[<Mdx>string</Mdx>]}
>
<ObjectSummary>
The ID of the collection.


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="image"
    types={[<Mdx>[image](https://developer.shopline.com/docs/sline/object/image.md)</Mdx>]}
>
<ObjectSummary>
The cover image for the collection.

This cover image is added on the collection's page in the SHOPLINE Admin.


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="products_count"
    types={[<Mdx>integer</Mdx>]}
>
<ObjectSummary>
The total number of products in the current view of the collection.


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="published_at"
    types={[<Mdx>string</Mdx>]}
>
<ObjectSummary>
A timestamp for when the collection was published.

> **TIP**
>
> Use the [date filter](https://developer.shopline.com/docs/sline/filter/date.md) to format the timestamp.
</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="sort_by"
    types={[<Mdx>string</Mdx>]}
>
<ObjectSummary>
The value of this field is the sorting order of the product collection specified by the URL parameter `sort_by`. It returns `null` if the parameter is not provided.


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="sort_options"
    types={[<Mdx>array of string</Mdx>]}
>
<ObjectSummary>
The available sorting options for the collection.


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="tags"
    types={[<Mdx>array of string</Mdx>]}
>
<ObjectSummary>
These are the active tags for the current product collection view, containing only the tags of products that have not been filtered out. If no tags are applied, or all tagged products in the current page have been filtered out, an empty array is returned.


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


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="url"
    types={[<Mdx>string</Mdx>]}
>
<ObjectSummary>
The relative URL of the collection.


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


