Template Docs Commerce APIs Webhooks Tools
Get Started
Get Started

Collections

A site can have an unlimited number of collection types. Each collection can be configured to support specific post types and can be sorted chronologically (like a blog) or user ordered (like a gallery).

System Collections

Squarespace creates and maintains several collection types in the system you can use in your site without needing the files in your template. We call these "system collections." To add a system collection to your site, add an array to your template.conf file that specifies which collections you'd like to use.

"systemCollections" : [
  "album",
  "blog",
  "events",
  "gallery",
  "products"
]

System collections require no coding or maintenance by the developer. The system collection code is maintained by Squarespace and is not available for customization. For information about custom collections, see below.

Creating Custom Collections

To create a custom collection on your site, you need to create a configuration file (.conf) and a .item and/or .list file to accompany the .conf file.

Collection Configuration (collection.conf)

Contains the configuration settings for a collection. There must be a configuration file for each collection you create.

{
  "title" : "Blog",
  "ordering" : "chronological",
  "addText" : "Add Post",
  "acceptTypes" : [ "text" ]
}

Configuration Options

  • title: The name of the collection as it will appear in the "Add New Page" dialog.
  • ordering: The method of ordering for the collection. Available options: chronological, user-orderable, calendar.
  • addText: Specifies the text used in the "add" button in the Squarespace interface. It is also used in empty collection message when a collection does not contain any items.
  • acceptTypes: Specifies the post types allowed in this collection. Available: text, image, video.

Collection List Views (collection.list)

This is the default view of every collection and shows all posts in that collection. For example, blog.list templates a list of blog posts.

Collection Item Views (collection.item)

Item views are templates for the individual pages of a collection item (permalink). Example: blog.item templates a single blog post page.

TIP: Exclude the .list file to start on item view

If a .list file is not provided, the .item becomes the default template for the collection, thus starting viewers on the first individual item page instead of the collection's list page.