PageRoost Variables

Weird looking code that does cool stuff.

What Are PageRoost Variables?

A "PageRoost Variable" is really just a bit of Smarty code that you can use to get access to information dynamically. For example, you could use a PageRoost Variable to get access to the internal name of a page by calling the {{$Page.internal_name}} variable. Below is a list of variables and the information they contain.

By default, smarty uses a single curly brace for it's delimiters (the things at the beginning and the end of the code). We found this caused too many problems so we set it to double curly braces, like Handlebars. So, anywhere you see an example on the Smarty site, remember, in PageRoost, you need to use the double curly braces.


Page Variables

Page variables provide access to information about the current page.

{{$Page.id}}
The internal ID of the current page.
{{$Page.template_id}}
The internal ID of the current page.
{{$Page.internal_name}}
The internal name of the current page.
{{$Page.title}}
The title of the current page as it appears in the browser tab or titlebar.
{{$Page.meta_description}}
The meta description for the current page.
{{$Page.url}}
The URL of the page without a leading slash (e.g. about-us/our-team). The URL for the homepage will be empty.
{{$Page.publish_start}}
The date and time of the "Publish Start" date for the page in UTC.
{{$Page.publish_end}}
The date and time of the "Publish End" date for the page in UTC.
{{$Page.head}}
Any code that appears in the <head> section of the current page.
{{$Page.foot}}
Any code that appears before the </body> tag of the current page.
{{$Page.body_class}}
The CSS class/classes applied to the <body> tag of the current page.
{{$Page.include_in_sitemap}}
Whether or not this page is included in the sitemap.
{{$Page.track_visits}}
Whether or not to track visits to this page.
{{$Page.created}}
The date and time the page was created in UTC.
{{$Page.CreatedBy}}
See Page Author Variables. Used like {{$Page.CreatedBy.name}}.
{{$Page.modified}}
The date and time the current page was last modified in UTC.
{{$Page.ModifiedBy}}
See Page Author Variables. Use like {{$Page.ModifiedBy.name}}.
{{$Page.created_timestamp}}
A unix timestamp of the "created" date and time localized the site timezone.
{{$Page.modified_timestamp}}
A unix timestamp of the "modified" date and time localized to the site timezone.
{{$Page.publish_start_timestamp}}
A unix timestamp of the "publish start" date and time localized to the site timezone.
{{$Page.publish_end_timestamp}}
A unix timestamp of the "publish end" date and time localized to the site timezone.

Page Author Variables

Page author variables provide information about the users who created and modified the page.

{{$User.id}}
The internal ID of the user.
{{$User.group_id}}
The internal group ID of the page.
{{$User.name}}
The name of the user.
{{$User.timezone}}
The timezone of the user. Formatted like America/New_York.
{{$User.created}}
The date and time the user was created in UTC.
{{$User.modified}}
The date and time the page was last modified in UTC.

Template Variables

Using any of these variables will provide information about the current page's template.

{{$Template.id}}
The internal ID of the template.
{{$Template.name}}
The name of the template.
{{$Template.head}}
Any code that appears in the <head> section of pages that use the template.
{{$Template.foot}}
Any code that appears before the </body> tag of pages that use this template.
{{$Template.body_class}}
The CSS class/classes applied to the <body> tag of pages that use this template.
{{$Template.created}}
The date and time the template was created in UTC.
{{$Template.modified}}
The date and time the template was last modified in UTC.

Setting Variables

Setting variables provide access to values from site settings.

{{$Setting.site.foot}}
Any code that appears before the </body> tag of all pages.
{{$Setting.site.primary_domain}}
The primary domain of the site.
{{$Setting.site.name}}
The name of the site.
{{$Setting.site.favicon}}
The favicon for the site.
{{$Setting.site.logo}}
The logo for the site.
{{$Setting.site.primary_email}}
The primary e-mail address for the site.
{{$Setting.site.head}}
Any code that appears in the <head> section of all pages.
{{$Setting.site.timezone}}
The timezone of the site. Formatted like America/New_York.

Visitor Variables

Visitor variables are unlimited and based on the Form Fields that you have in your system. They are populated when a visitor submits a form on your website and as such, by default, they will be empty. To access visitor variables, use a lowercase version of the field name with all spaces and special characters replace with an underscore. 

Examples
Display the "First Name" field of a visitor

{{$Visitor.first_name}}

Display the "E-mail Address" field

{{$Visitor.e_mail_address}}

You can locate the visitor variable name on the "Manage Form Fields" page. Read about managing form fields in PageRoost.


Form Variables

Form variables are only available for use in form autoresponder subjects and messages.

{{$Form.name}}
The name of the form that was submitted.