Region Tags

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

Squarespace Script Tag

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

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

Squarespace Block Field Tag

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

Creates an open area where users can add any system block. Primarily used for sidebar and footer areas, the columns attribute can be set to either 1 or 12. Ideally, this value should be set to 12, but you can set it to 1 if you want to limit the user to only a single column of blocks.

Squarespace Headers

{squarespace-headers}

Injection point for Squarespace scripts, system generated meta tags, and user content from the 'Header Code Injection' point found in the 'Code Injection' tab.

Site- and Page-Specific Body Classes

{squarespace.page-classes}

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

Page ID

{squarespace.page-id}

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

Main Content

{squarespace.main-content}

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

Squarespace Footers

{squarespace-footers}

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

 

Collection Tags, Helpers and Predicates

These tags are used in collection template files (.list, .item). The @ symbol in the code samples refers to the local scope, so these code samples can be used inside of a {.section item} or {.repeated section items}. Alternatively, if you're working on an item page the @ symbols can be replaced by the word "item".

Item Classes

{@|item-classes}

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

Share Button

{@|social-button}

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

Comments

{@|comments}

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

Comment Link

{@|comment-link}

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

Comment Count

{@|comment-count}

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

Squarespace Simple Like Button

{@|like-button}

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

Post Blog Entry Code Injection

{squarespace-post-entry}

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

Image Attributes

{@|image-meta}

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

Product Price

{@|product-price}

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

Product Variants, Quantity, Add to Cart Button

{@|product-status}

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

Main Image Predicate

{.main-image?}
  <!-- code here -->
{.end}

Tests if a collection/item has a main image.

Excerpt Predicate

{.excerpt?}
  <!-- code here -->
{.end}

Test if an item has an excerpt.

Comments Enabled Predicate

{.comments?}
  <!-- code here -->
{.end}

Tests if comments are enabled for a particular item.

Disqus Enabled Predicate

{.disqus?}
  <!-- code here -->
{.end}

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

Video Predicate

{.video?}
  <!-- code here -->
{.end}

Tests if an item in a gallery is a video.

Even Predicate

{.even?}
  <!-- code here -->
{.end}

Tests if an item's index position is even.

Odd Predicate

{.odd?}
  <!-- code here -->
{.end}

Tests if an item's index position is odd.

Equal Predicate

{.equal? arg1 arg2}
  <!-- code here -->
{.end}

Tests if two arguments are equal. If true, anything between the condition and {.end} will be outputted. If either of your arguments could contain a space, use a different delimiter to ensure an accurate return like so: {.equal?:arg1:arg2}.

Item Index

{@index}

Outputs the current index of the item. Numbers start with 0.

 

Navigation Tags and Predicates

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

Navigation Tag

<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 Predicate

{.collection?}
  <!-- code here -->
{.end}

Tests if a navigation item is a collection.

External Link Predicate

{.external-link?}
  <!-- code here -->
{.end}

Tests if a navigation item is an external link.

Folder Predicate

{.folder?}
  <!-- code here -->
{.end}

Tests if a navigation item is a folder.

 

URL Queries

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

JSON Format

http://your-site.squarespace.com/?format=json

Returns website and collection data in JSON format.

Prettified JSON Format

http://your-site.squarespace.com/?format=json-pretty

Returns website and collection data in a prettified JSON format.

RSS Format

http://your-site.squarespace.com/?format=rss

Returns website and collection data in RSS format.

Main Content Format

http://your-site.squarespace.com/?format=main-content

Returns full generated html for pages (not collections).

Category Filter

http://your-site.squarespace.com/?category=[categoryName]

Returns list of collection items, filtered by given category.

Tag Filter

http://your-site.squarespace.com/?tag=[tagName]

Returns list of collection items, filtered by given tag.

Month Filter

http://your-site.squarespace.com/?month=[monthPublished]

Returns list of collection items, filtered by given month.