Instance Functions
Learn how to use all of Parsley's instance functions to access instance variables.
instance.cdn
Access the full url to the Satellite™ CDN.
{{ instance.cdn }}
instance.date()
Access the date from the Satellite. Additional formatting options.
Please note that this Parsley call outputs the current date in GMT time zone.
{{ instance.date() }}
instance.host_env
Shows the instance's webengine URL. This only works in preview - not on live.
{{ instance.host_env }}
instance.host_live
Shows you the instance's first registered domain. This only works in preview - not on live.
{{ instance.host_live }}
instance.host_preview (or instance.host_relative)
Shows an instance's preview URL. This only works in preview - not on live.
{{ instance.host_preview }}
{{ instance.host_relative }}
instance.host_protocol
Shows the instance's protocol based on its settings. This only works on preview - not on live.
{{ instance.host_protocol }}
instance.searchformatted(search_term)
Search a Satellite's meta titles and descriptions.
Returns search results in this format:
<ol class="search-formatted">
<li onclick="window.location='/menu-sweet/'">
<a href="/menu-sweet/">Sweet Menu</a>Meta Page description
</li>
</ol>
Parsley code used to return the the search results:
{{ instance.searchformatted(my search term) }}
instance.domain
If domain is set for the instance, this call will return it.
{{ instance.domain }}
instance.lorem(number)
Generate lorem ipsum placeholder text on the fly.
{{ instance.lorem(200) }}
instance.sendemail(subject, body, to_address)
Send an email with a Parsley call. This requires a verified email in settings > contact form. Use ,, the ascii code for a comma in place of commas in the subject and body arguments.
{{instance.sendemail(hello stuaaaaaart,You are my biggest, bestest fan, [email protected])}}
instance.subnav()
Generate a formatted Sub Navigation.
<ul id="sub-navigation" class="sub-navigation">
<li>
<a class="sub-navigation categories" href="/about/categories/" title="The Categories">The Categories</a>
</li>
</ul>
show two sub levels and the auto generated header
<h5 class="sub-navigationHeader"><a href="/about/" title="About" class=" at">About</a></h5>
<ul id="sub-navigation" class="sub-navigation">
<li>
<a class="sub-navigation categories" href="/about/categories/" title="The Categories">The Categories</a>
</li>
</ul>
{{ instance.subnav(false) }}
{{ instance.subnav(true 2) }}
instance.truepath(ZUID)
Truepath takes in a UUID-like identifier, called a "ZUID", which can be located in the the Zesty.io Manager url. Truepath returns a perfect url path to the znode content id. Use true path to ensure links never break.
{{ instance.truepath(501) }}
Updated 11 months ago