All templates on a ShadoCMS page have available to a rich variety of variables that make the task of developing quite rapid and simple.
Most of these variables are available in the request scope. A few are available in the application scope as well.
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.
- request.contentfreeze: When set to true, the container controls are not shown. It shows the text "[Content Freeze in Place]" instead of controls. This is setup as a variable against a section in the Site Tree.
- request.userContext.hidecontainerControls: When set to true, the container controls are not shown when a container is being edited.
- request.allowContainerTreeEdit: When set to true, allows to edit containers from the sitetree. We decided to not allow this functionality by default. The reason is that styles there may not reflect the actual styles used in the front end of the site.
- request.useAjaxControls: When set to false, containers of type HTML, won't use Ajax controls for tasks like saving/publishing content, undoc heckout container, remove container from page and content rendering.
- request.publishContentConfirmationMessage: When created, a javascript confirmation message will show the saved text against this variable before publishing a container content. If set to false or not created, it will not ask for any confirmation after pressing the "Publish Content" button.
- request.hideContentPublishDateControls: When created and set to true, the javascript calendar controls will be hidden and users will not be able to change the container's publish date.
- request.isEditorInitialized: Created automatically by ShadoCMS. It is used as a flag when rendering containers in a page (in edit mode) to identify whether the needed javascript files for the editor and containers have been included or not.
- request.wf_stopallemails: When setup as a global variable against a site and set to false, all emails sent out by the ShadoCMS workflow notification system are suppressed. If set to true (or if the variable is removed), all emails are sent out as normal.
- request.wf_logemailactions: When setup as a global variable against a site and set to true, all the workflow email activity is logged under /sitename/app_config/logs/workFlowEmail.cfm file.
- request.wf_defaultfromemailaddress: When setup as a global variable against a site and contains a valid email address, all workflow emails sent out by the ShadoCMS workflow notification system are sent from this email id. This is used in conjunction with request.wf_overridefromwithdefault.
- request.wf_overridefromwithdefault: When setup as a global variable against a site and set to true, the request.wf_defaultfromemailaddress is used for sending out workflow notification emails.

