Designers - Variables
Variables are simply strings surrounded by ~ tilde marks, for example:
~full_name~
~total_amount~
Above are examples of variables, and upon the template being rendered, will be replaced with their corresponding value. Every page / operation is different, and please consult with either any available documentation or the back-end developers for a list of variables the templates support.
Arrays
Arrays are also supported and are separated by a period. For example:
~user.email~
~user.full_name~
The above would be replaced with the "username" and "full_name" elements of the "user" array. Again, please consult with the back-end developers as to which variables the templates support.
User Profile
If a user is authenticated, their profile is available via the profile
array on all pages. This array contains the following keys:
- uuid
- is_active
- is_pending
- is_frozen
- has_password
- has_email
- has_phone
- email_verified
- phone_verified
- username
- phone
- phone_country
- phone_national
- phone_formatted
- full_name
- first_name
- last_name
- group_id
- group_name
- timezone
- language
- currency
- created_at
- updated_at
- reg_country
- reg_province
- reg_city
- reg_ip
- reg_user_agent
For example, within any template where a user is authenticated, you may put something such as:
Welcome ~profile.username~, your e-mail address is ~profile.email~
Global Variables
The following global variables are available on all templates:
- ~theme_uri~
- ~is_auth~ -- A 1 or 0 defining whether the user is authenticated.
- ~user_type~ -- Will be public if user is not authenticated, and otherwise the type of user that is authenticated (ie. user / admin).
- ~current_year~
SIte Array
The site
array is also available on all templates, which is replaced with values the administrator defines via the Settings->General menu of the administration panel. This includes things such as company name, e-mail address, Facebook / Twitter URLs, et al. Below are all keys available in the site
array:
- name
- address
- address2
- phone
- tagline
- about
- youtube
- github
For example, you may use something such as the following on any template;
Welcome to ~site.name~, our company e-mail address is ~site.email~