Accessing Content

When developing Parsley templates you can access the current contexts content. The properties available in your current context are a combination of Zesty defaults and fields the developer has configured as part of the content schema. Developer created properties will be accessible by the fields reference name. This is a computer friendly slug that is generated from the display name given to each schema.

Basic Usage

The most common context is {{page}}, which refers to the current page instance. Any field created in this pages content schema can be accessed by it's reference name; for example; {{page.title}}.

SEO Fields

Zesty default fields. Every page created has default SEO fields. Zesty uses these to ensure all pages include necessary SEO meta information. All of these fields are available for developer use.

  • seo_link_title — This is the title used for a link in navigation.
  • seo_meta_title — This is the page title and the value in the <title> tag.
  • seo_meta_description — This is the page description normally just used for search engines. You might utilize it for a short description of a page in a list view somewhere.

Accessing a Page's URL

URLs are dynamic and can change over time. You can give content editors control of their page urls from each pages content editing view.

URL editing in the Zesty content view

Developers can get a reference to this dynamic URL with the getUrl() Parsley function. Any set that has a URL can be retrieved with the getUrl() function. Common scenarios are referencing a single page's URL or iterating over each page in a pageset and referencing the page URL.

Direct Dataset Access

This is useful for accessing a single item without using an each loop, and also useful for accessing parented items inside of an each loop