Variables
Introduction
Various variables are made available for use in your blocks, pages and templates. These variables allow you to have data dynamically placed into your pages. Examples include title, date, site name, and current user. You could, for instance, use the { {site.name} } variable in your template to have the name of your site automatically added to all of your pages.
Usage
All variables need to be wrapped around double curly brackets: { {variable} }. For variables that have specific attributes, the two are separated by a period: { {variable.attribute} }. (Note: be sure to not include a space in between the curly brackets)
Available Variables
| Variable | Attributes | Description |
| requesting_object | name | The name of the asset being requested |
| site_path | The path to the asset being requested | |
| created_by | The user that created it (user functions are applicable e.g. requesting_object.created_by.username) | |
| updated_by | The user that updated it (user functions are applicable e.g. requesting_object.updated_by.first_name) | |
| created_at | The time it was created (combine with pretty_print e.g. requesting_object.updated_at | pretty_print) | |
| updated_at | The time is was last updated (combine with the pretty_print_date function) | |
| title | - | The name of the asset being requested. Note: this is a shortcut to requesting_object.name |
| user | username | The username of the currently signed-in user |
| first_name | The first name of the currently signed-in user | |
| last_name | The last name of the currently signed-in user | |
| site_path | The profile path of the currently signed-in user | |
| site | name | The name of the current site |
| description | The description of the current site | |
| site_path | The path to the current site | |
| request | date | The HTTP request date |
| url | The HTTP request URL | |
| date.year | The current year | |
| variables | The various URL parameters of the HTTP request | |
| browser_type | The requesting browser type | |
| referer | The HTTP request referer | |
| sign_in_url | - | The URL used for signing in |
| sign_out_url | - | The URL used for signing out |
No attachments
No comments
Sign in | Free trial sign up | Follow eCrowds on Twitter