Tag Reference

This page is intended to be a quick reference to the most common tags, helpers, predicates, and URL queries. These tags and formatters are an extension of what is already available in JSON Template. Read the JSON Template Docs for more information.

Region Tags

These tags are used in region files (.region).

<squarespace:script src="script.js" combo="true" />

Scripts loaded with the squarespace script tag will be rolled up into the global script combo file. Optional, you can load scripts normally if you do not want to take advantage of this feature. Source points to a file in /assets/.

<squarespace:block-field id="blockName" columns="12" />

Block Field tag. Creates an open area where users can add blocks. Primarily used for sidebar and footer areas. The columns attribute can currently be set to 1 or 12. It is usually best to set this to 12, but you can set it to 1 where you want to limit the user to a single column of blocks.

{squarespace-headers}

Injection point for squarespace scripts, meta tags, and user content from the 'Code Injection' tab.

{squarespace.page-classes}

Adds site- and page-specific classes - use on <body> tag..

{squarespace.page-id}

Adds page-specific id - use on <body> tag.

{squarespace.main-content}

Injection point for page templates in site region files. This is where your collection or page will be injected.

{squarespace-footers}

Injection point for tracking scripts and user content from the 'Code Injection' tab.

Collection Tags, Helpers and Predicates

These tags are used in collection template files (.list, .item)

{item|item-classes}

(recommended) Adds useful item-specific classes (incl. author, category, tag, post type, item number, etc.).

{item|social-button}

Includes pre-built share button that can be configured in the 'Share Button' tab.

{item|comments}

Includes pre-built comments that can be configured in 'General' settings tab.

adds <a href="link-to-comments" class="sqs-comment-link" data-id="itemId">[X] Comments</a> or Disqus comment text

{item|comment-count}

generates pluralized comments message (ex. '3 Comments'), or 'No Comments'.

{item|like-button}

Includes pre-built simple like button that can be configured in 'General' settings tab.

{squarespace-post-entry}

Injection point for user content. Typically placed after each item in a blog collection.

{item|image-meta}

Used to add attributes to an image tag (focal point data, image source, original image dimensions).

{item|product-price}

Injects the price of an item in a products collection. This tag also formats the price into a currency format.

{item|product-status}

Pulls in the variants, quantity, and add to cart button for products.

{.main-image?}

Tests if a collection/item has a main image.

{.excerpt?}

Test if an item has an excerpt.

{.comments?}

Tests if comments are enabled for a particular item.

{.disqus?}

Tests if disqus comments have been enabled (only useful in items with comments).

{.video?}

Tests if an item in a gallery is a video.

{.even?}

Tests if an item's index position is even.

{.odd?}

Tests if an item's index position is odd.

{.equal? arg1 arg2}

Tests if the two arguments are equal. If true, anything between the condition and {.end} will be outputted.

{@index}

Outputs the current index of the item.

These tags are used in navigation blocks (usually named navigation.block).

<squarespace:navigation navigationId="navTitle" template="templateName" />

Navigation include tag. Binds navigation data (navigationId) to a block template file (template). See Menus & Navigation for more information.

{.collection?}

Tests if a navtigation item is a collection.

tests if a navigation item is an external link.

{.folder?}

Tests if a navigation item is a folder.

URL Queries

These query strings can be appended to any Squarespace collection URL.

?format=json

Returns website and collection data in JSON format.

?format=json-pretty

Returns website and collection data in a prettified JSON format.

?format=rss

Returns website and collection data in RSS format.

?format=main-content

Returns full generated html for pages (not collections).

?category=[categoryName]

Returns list of collection items, filtered by given category.

?tag=[tagName]

Returns list of collection items, filtered by given tag.

?month=[monthPublished]

Returns list of collection items, filtered by given month.