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. Optional, you can load scripts normally if you do not want to take advantage of this feature. Source points to a file in /assets/.

Block Field Tag

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

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

{squarespace-headers}

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

Site- and Page-Specific Body Classes

{squarespace.page-classes}

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

Page ID

{squarespace.page-id}

Adds page-specific id - 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

{sqarespace-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 Classes

{item|item-classes}

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

Share Button

{item|social-button}

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

Comments

{item|comments}

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

Comment Link

{item|comment-link}

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

Comment Count

{item|comment-count}

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

Squarespace Simple Like Button

{item|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

{item|image-meta}

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

Product Price

{item|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

{item|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 the two arguments are equal. If true, anything between the condition and {.end} will be outputted.

Item Index

{@index}

Outputs the current index of the item.

 

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.