Parsley Index

._index

When looping through a collection with an {{ each }} loop, you can use variable_name._index to get the current count of how many times you have run through the each loop. _index begins counting from 0. To start counting at 1 use _num instead.

._length

When looping through a content collection, you can call {{ variable_name._length }} to get the total number of times the loop will run.

._num

When looping through a collection with an {{ each }} loop, you can use variable_name._num to get the current count of how many times you have run through the each loop. _num begins counting from 1. To start counting at 0 use _index instead.  

.activate_links()

Converts plain text URLS into anchor tags <a href="URL">URL</a>. Useful for the social curator tool, where text comes in with HTML stripped.

.date(format)

Uses the php date format to create the date string shown to the user.

.dateDiffForHumans()

This method creates an expression of duration. 

.first()

Data Calls allow you to access any object entered into the Zesty Content Area. Data calls will allow you to focus on a particular object, and only return one object. If you are looking to access multiple objects, reference each loops

.format_currency()

If you have a float number you want to represent in the format $XX.XX, use format_currency()

.getfeedurl()

Every set of data in Zesty (page sets or dataset) can access a public RSS feed.

.getImage(width, height, type)

Function takes a width, height, and an optional type (fit or crop) parameter and returns a URL to that image. There are many ways to utilize this function. Fit is the default and does not need to be explicitly declared. Crop type requires 2 parameters and explicit declaration.

.getImageFileName()

When called on a image reference, returns the image file name.

.getImageTitle()

When called on an image reference, returns the image title.

New

.getMediaURL()

Function does not takes parameters and returns the original URL to that file. This is how to access files stored in media that are not images, such as PDFs and MP4s. You can also use this call to access the original file of an image that has not been optimized or altered by Zesty.io. 

.getNextURL()

A quick way to retrieve the next URL inline in a page set.

.getPreviousURL()

Quick access to the URL of the previous page inline in a page set.

.getUrl()

Returns the relative path to the item you are trying to access.

.gravatar(email)

Function takes a user's email and requests an image from the Gravatar API.

.hasChildren()

Find out if a page has pages that live under it. This is helpful when using logic to create secondary navigations.

.hasNext()

Check if the current page has a next siblings.

.hasPrevious()

Check if the current page has previous siblings.

.html_entity_decode()

Converts all HTML entities in the provided string to their applicable characters.

.htmlentities()

Converts the text string provided into HTML entities. Useful for when outputting text from the database.

.htmlentities()

Convert all applicable characters to HTML entities.

.inStock()

Used for store items as a quick inventory check. Returns false if no inventory is available for purchase.

.obfuscate()

Use this call to render obscure text to web crawlers, like email or phone numbers.

.preg_replace(pattern, replacement)

Does a regular expression find and replace on the text attached to the call.

.random()

Data Calls allow you to access any object entered into the Zesty Content Area. Data calls will allow you to focus on a particular object, and only return one object. If you are looking to access multiple objects, reference each loops

.replace(pattern, replacement)

Does a simple replace without any regular expression.

.striptags()

Strip HTML tags from a string.

.striptags(start, length)

Function will return a string with HTML tags removed. It also acts as a substring method if a start and length parameter are provided.

.substr(start, length)

Function that takes the text value it is attached to and returns a substring with the desired length. Does not consider whitespace as part of length.

.subWords(number_of_words)

Return the first X words from a body of text. This is a cleaner method and subString() when creating text previews in lists.

.trim_zeros()

If you have a number like 8.0000000 and want it to just show 8, use trim_zeros().

{{ $ }}

Variables are expressed using the $ character.

{{ api.dribbble }}

{{ api.tinyurl }}

{{ api.twitter }}

{{ clippings }}

Deprecated

{{ content }}

Replaced by {{current_view}}

{{ current_view }}

Current View is a unique zesty statement that will access the page view associated with the website url, this should only be used once. It is typically found in the loader view, but can be used anywhere outside of a loop.

{{ each ... }}

Each statements, traditionally known as loops, allow you to iterate (loop) through each object of a dataset.

{{ else }}

{{ end-each }}

{{ end-if }}

Required to close an {{if}} statement.

{{ get_var }}

When using a form's GET method, form data is available on the {{get_var}} object in the submitted to template page. The submitted to page is the value of the action attribute.

{{ if ... }}

Parsley {{if}} statements allow you to control which template blocks are evaluated by using a conditional in the statement.

{{ include }}

Include lets you insert a zesty view within the view you are in.

{{ navigation }}

Navigation will access your Zesty Navigation Structure and output it as an HTML list. By default Zesty will mimic the exact content navigation layout you find in the Zesty Content Manager.

New

{{ page }}

The {{page}} object represents the current page. It allows access to the data associated with the page; e.g. {{page.title}}. Any field created in the content Schema can be accessed using this method when you are on its associated page.

{{ paypalStandard(action, product, price, shipping) }}

Quickly create a Paypal Standard buy, donate, or add to cart button in Parsley. All one needs to start using Paypal Standard a Paypal account. You can create one here. The Paypal account information and tax rate are set in Settings->Paypal Standard. These must be set to send money to the appropriate account. Action can be buy, addtocart and donate.

{{ post_var }}

When using a form's POST method form data is available on the {{post_var}} object in the posted too template page. The posted to page is the value of the action attribute.

{{ sectionlinks }}

{{ sectionlinks }} looks at the current page you are one and reaches up to its upmost parent to create a navigation structure as an HTML list. By default dataset items are not shown here. Depth can be specified by passing an integer; e.g. {{ sectionlinks(2) }}. Alternatively you can choose not to display the top level page by passing {{ sectionlinks(off) }}

{{ setting }}

Allows you to access Zesty Settings saved in the Zesty manager

Deprecated

{{ thispage }}

Gives a reference to the current page. Replaced with {{page}}.

{{ youtubepage }}

To access the zesty youtube plugin, simply call {{ youtubepage }} and a video player and playlist to be created. To access a specific playlist, call {{ youtubepage(myplaylist) }}

math( statement )

Use to calculate math, and can accept page variable or set variables.

site.breadcrumbs

Outputs an automated breadcrumb trail of links. If there are no available links, then an empty span is outputted.

site.cdn

Return the CDN container url. This can be used for looping through datasets to dynamically build media urls.

Example Output: https://XYZ.ssl.cf2.rackcdn.com/

site.current_lang

Return the current language the site is in. Zesty.io uses lang codes like EN or EN-gb

site.date

Output a date based on specific string format.

site.domain

If the website is live, this call will return the site's domain.

site.lorem(number)

Auto generates lorem ipsum placeholder content from this exmaple string:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam volutpat quam quis erat tristique pretium. Nunc iaculis lacinia nulla, quis pulvinar lorem rhoncus quis. In adipiscing, sapien blandit dictum pulvinar, massa nisl pretium nunc, vel volutpat nisl leo id justo. Sed ut elit nulla. Vestibulum pharetra est sit amet odio bibendum pharetra. Mauris magna dolor, mollis ac dignissim vitae, sollicitudin et arcu. Vivamus nec ultrices augue. Quisque libero diam, facilisis in ullamcorper vitae, condimentum vitae erat. Ut lacinia lacus in tellus scelerisque vestibulum. Praesent pharetra ligula lacus, at ultrices felis dictum ac. Cras consectetur ut dolor vitae dapibus. Vestibulum sit amet nibh semper, ornare erat vel, consectetur sapien.

site.searchformatted

Takes a string parameter and a limit paramenter and outputs a site wide search results based on a meta title, meta desription, and page url.

site.subnavigation

Generates an automated sub navigation area, this is the same at {{sectionslinks}}

truepath()

Given a zID will determine the web url to access the content. Can not have spaces within single bracket hugs.