Appendix: Displaying Values from Environment Variables
An environment variable is a special type of property supplied by a website. Examples of this include the time the current page was loaded, and the site's full URL. Any browser that connects to a site can access the values assigned to its environment variables. To render one of these values within KnowledgeKube content, you must use an ENVIRONMENT element tag.
The syntax for the tag is as follows, where Variable is a keyword that identifies the value you want to display:
<%# ENVIRONMENT(Variable) %>
You can quickly insert specific environment tags in HTML markup using the Element Browser. Click the Show Assets toolbar button, use the Filter to select Tags, then select the relevant item from the list. Not all environment variables exist in this list.
The following table lists the environment variables that can be rendered using an element:
Variable | Rendered Output | Example |
---|---|---|
AUTHENTICATION | The authentication status of the current user. | Logged Out |
CLEANURL | The full URL of the current page, including the site root but excluding the query string if present. | https://example-site.co.uk/test-page |
CULTURECODE | The culture code for the current page. | en-GB |
CULTURENAME | The name of the culture for the current page. | English (United Kingdom) |
CURRENTPAGE | The full URL of the current page, including the site root and the query string if present. | https://example-site.co.uk/test-page?st=test |
CURRENTPAGEURL | The URL of the current page, relative to the site root. If the URL's query string includes the refresh property, this will be omitted. | /test-page/test-subpage?index=15 |
CURRENTPAGEPARENTURL | The URL of the current page's parent page. | /test-page/ |
DATE | The date when the current page was loaded. | 24/12/2019 |
DATETIME | The date and time when the current page was loaded. | 24/12/2019 11:55:29 |
HOMEPAGEURL | The full URL of the site's home page, including the site root. | http://myexample.com/homepage |
LASTPAGEURL | The URL of the page visited prior to the current one, relative to the site root. If the URL's query string includes the refresh property, this will be omitted. | /homepage?utm_nooverride=1 |
LASTSITEPUBLISH | The date and time when the current version of the site was published. | 24/12/2019 11:55:29 |
LASTSITEREFRESH | The date and time when the current site was last refreshed. | 24/12/2019 11:55:29 |
MACHINENAME | The name assigned to the application's web server by the server administrator. | DEVELOPMENTHOST01 |
PAGETITLE | The current page's Default Title. All new blank pages include one of these tags by default. | Test Page |
PAGEURL | The current page's Virtual Page Name. | test-page |
SITE | The site's URL. | https://example-site.co.uk |
SITENAME | The site's name. | BasicSite |
SITETITLE | The site's title. | Example-Site |
TIME | The time when the current page was loaded. | 11:55 |
USERID | The logged-in user's unique ID. | 0a6e4e15-abe7-4ce8-9bae-6a825bb4f0b5 |
USERNAME | The logged-in user's User Name. | Aaron A. Aaronson |