When working with templates, ShadoCMS makes available a whole bunch of variables. These variables can be used in templates for accomplishing tasks like conditional processing.
Here is a list of some important variables.
Application Scope
- application.shado: contains a lot of information about the ShadoCMS application. This is shared across sites.
- application.shado_obj_factory: a caching component that allows for quick and efficient retrieval of ShadoCMS core components.
Request Scope
Variables in the request scope can be setup for the whole site or for section or for a page. Request variables also related to different parts of a ShadoCMS module you are working with, e.g., templates, editor, and so on. Some request variables are setup by the developer/administrator, and some are made available by ShadoCMS.
- request.userContext: Created automatically by ShadoCMS, it is essentially the session store for each active user browsing a site. More on request.userContext can be found here.
- request.userContext.mode: Contains a value of 0 or 1. 1 = View mode, 0 = Edit mode.
- request.userContext.language: Contains a structure containing information about the language that a user is viewing the site in.
- request.userContext.loggedin: Contains a value of false or true. If true, the user is logged in, and some other variables are available: request.userContext.user_emailAddress, request.userContext.user_uuid.
- request.userContext.shadomaster: If the user is an administrator, the value of this variable is 1. Else it is 0.
- request.siteContext: This is available across all pages in a site. More on this can be found here.
- request.siteContext.dsn: Stores the name of a site. Since the name of the site is the same as that of the ColdFusion datasource name (dsn), this can be used to programmatically retrieve the site name.
- request.siteContext.dbConnection: A structure containing information about the database connection used for a site.
- request.siteContext.app_globals: A query containing all the global variables setup for a site.
- request.siteContext.getLanguages(), request.siteContext.getGlobalProperty(), etc. are some methods available. For a complete list, dump the request.siteContext variable.
- request.sapi: Contains cached versions of all the SAPI components
- request.sapi.site.getPage(): getPage() is a function in a cached component called site.cfc. The function returns information about the page that a user is browsing. More on this can be found here.
- request.getPageObject: Contains a query containing all the information about the page that a user is browsing. Although it has been deprecated, it is still available for backward compatability.
The following variables are normally setup in Shado Central as Global Variables (System > Global Variables > List). These are usually available in the request scope.
- request.stylesheet: Path to the site stylesheet. This is used at the time of rendering pages. The path starts after /yoursite/app_templates/ folder. So, for example, if your stylesheet lives at /yoursite/app_templates/css/styles.css, the value for this variable should be set to css/styles.css.
- request.editor_stylesheet: Path to the stylesheet that is used by the editor to display style names in the styles drop-down. The path starts after /yoursite/app_templates/ folder. So, for example, if your stylesheet lives at /yoursite/app_templates/css/editor.css, the value for this variable should be set to css/editor.css.
- request.useContentClasses: Can be set to true or false. If set to true, this enables use of content classes (also known as container content type). This allows for different types of container content than the default html type.
- request.respectMinimumPermissions: Can be set to true or false. If set to true, this enables applying front-end permissions to a site.
- request.showFriendlyErrors: Can be set to true or false. If set to true, any unexpected errors encountered in Shado Central are trapped and displayed gracefully. If set to false, the complete ColdFusion error message is displayed.
An updated list list can be found in the developer documentation.

