Learn Harmony

If you’d like to know when Harmony will be publicly available, just let us know your name and email address.


Objects

On any page, you’ll have access to a few objects and collections you can use to display, or find more data on your page. item is always the current page, and any data that it holds depending on its type (page, blog index, blog post, etc. site contains some basic information about the site. blog is available on any page inside a blog, and references the current blog object.

Asset

You can get access to assets that have been added to an item through template data.

Property Description
filename The filename of the asset
size The size of the asset, in bytes
url The full url to the asset

Blog

You’ll have access to the blog object on any page inside of a blog (post, archive, label, etc.). A blog also contains all the properties from Item.

Property Description
feed The blog feed, as an object
next The next sibling item, or nil if none exists
previous The previous sibling item, or nil if none exists
archives_by_month.x An array of the x most recent month archives
archives_by_year.x An array of the x most recent year archives
archive_folder_path The path to the blog archives (ie: /blog/archives/)
label_folder_path The path to the blog labels list (ie: /blog/labels/)
labels Blog labels as an array, ordered based on admin order. Currently limited to 50 labels.
last_updated_at The updated date of the last updated published blog post
recent_posts.n The n most recent posts. Eg. blog.recent_posts.5

Blog Archive Date

A blog archive date also contains all the properties from Item.

Property Description
blog The blog the archive belongs to, as an object
post_count The number of posts published in this date

Blog Archive Folder

A blog archive folder also contains all the properties from Item.

Property Description
blog The blog the archive belongs to, as an object

Blog Feed

A blog feed also contains all the properties from Item.

Property Description
blog The blog the feed belongs to, as an object

Blog Label

A blog label also contains all the properties from Item.

Property Description
blog The blog the label belongs to, as an object
post_count The number of published posts that have this label

Blog Label Folder

A blog label folder also contains all the properties from Item.

Property Description
blog The blog the label folder belongs to, as an object

Blog Post

A blog post also contains all the properties from Item.

Property Description
blog The blog the post belongs to, as an object
labels An alphabetized array of the post’s labels
newer The post published just after this post, or nil if none exists
older The post published just before this post, or nil if none exists
comments An array of the post’s comments
comment_count The number of comments on the post
accepting_comments? True if accepting comments is checked, otherwise false

Comment

You’ll have access to an array of comment objects on a blog post.

Property Description
body The content of the comment
date The date and time the comment was approved
email The comment author’s email address
html_id A unique formatted string usable for an html id value
name The comment author’s name
path The path to the comment (/path/to/post/#html_id)
url The comment author’s URL

Datum

You can get access to data objects using the “dataset” array on any item.

Property Description
key The key name of the datum
value The value of the datum entered for the item when managing content

Field

You can get access to an array of the current template data fields on any item using “fieldset”.

Property Description
name The name of the field
key The key name of the field

Item

Item is a general description for any page-like content on your site. Almost all other object types, like blogs and pages, inherit from Item, so they include all the same data that’s on an item.

Property Description
ancestors An array of ancestors of the given item, in order of closest relation
breadcrumbs An array of the item and its ancestors, in order of farthest relation (home page first)
created_at The date when the item was created
creator The user who created the item, as an object
data.foo The custom data relating to foo. Eg. item.data.content
dataset All the custom data for the item, as an array of data, ordered the same as the template data
fieldset An array of the current template data fields, ordered the same as the template data
html_id A string which can be used for html ids and classes
id The unique id for this object
parent The item’s parent as an object
path The URI path to the blog
published_at The date when the item was published
root? Returns true if the item is the home page, false if not
section The items top-level navigation item. Returns nil if the item is the home page.
self_and_ancestors An array of the item and its ancestors, in order of closest relation (item first)
slug The last part of the path, without slashes
template_name The name of the item’s template
title The title of the blog
updated_at The date when the item was last updated
updater The user who last updated the item, as an object
url The full URL of the item

A link also contains all the properties from Item.

Property Description
next The next sibling item, or nil if none exists
path The URL of the link
previous The previous sibling item, or nil if none exists
url.n The URL of the link

Page

A page also contains all the properties from Item.

Property Description
children The children of the item, ordered like the admin, in an array
navigation The children of the item with Show in Navigation selected, ordered like the admin, in an array
next The next sibling item, or nil if none exists
previous The previous sibling item, or nil if none exists

Site

You’ll have access to the site object in every template.

Property Description
title The site’s title
domain The domain of the site, as entered in the site’s settings
url The full URL of the site including http://
root The root page of the site
navigation An array of top items of your site (if Show in Navigation is selected), ordered like the admin.
recent_posts.n The n most recent posts for every blog in the site. Eg. blog.recent_posts.5

User

Property Description
name The users name
email The users email address
first_name The users first name
last_name The users last name