This tutorial was written for CMS Release 3.1.6.0
KEYWORDS in the CMS are a powerful way to extend the benefits of custom programming to non-technical CMS administrators. With them, one can easily display dynamic data, like the current date and time, store information to be passed to another page, or examine certain conditions to trigger an alert pop-up or a page redirection.
Keywords can also be used as content place-holders to pull in content from header, footer, and user templates.
All of the built-in system keywords have the same tag format, which looks like this:
Standalone Keywords: [##sys_keywordName##]
Keywords that take one or more parameters: [##sys_keywordName=parameter1;parameter2##]
To use the keywords, simply place them anywhere in a CMS webpage, and they will fulfill their function at the point they are placed. Some are designed to return data for display, while some return no data. Whatever the case may be, the keyword tag itself will not be visible when your webpage is displayed within the user’s web browser.
Content Place-holder keywords
· To return the value of a header, footer, or user template, just supply the template name in the standard CMS tag format, like this:
o [##driving_calculator##]
· The only rule of thumb here is to make sure you use distinctive template names for the various categories. In other words, if you named a user template the same as a footer template, the CMS would render the content from whichever template it located first. Try prefixing your template names like this:
o For headers: hdr_
§ [##hdr_homepage##]
o For footers: ftr_
§ [##ftr_homepage##]
o For user templates: user_
§ [##user_driving_calculator##]
Standalone Keywords:
· sys_togglefont
o Returns a URL that you can use in a hyperlinked button or image to allow your users to increase the font size of text on your CMS Webpage.
o Example: <a href=”[##sys_togglefont##]” originalAttribute="href" originalPath="”[##sys_togglefont##]”" title=”Click to enlarge text”>Enlarge Text</a>
o Notes:
§ Your CMS Webpages must be using DirectControl CSS style for this tag to work.
· sys_previous_page
o Returns the complete URL of the previously visited webpage.
o This tag can be used in place of a URL for hyperlink tags, or onClick events.
· sys_portal_user_id
o Returns the ID number that correlates to the Portal user account for the currently logged in portal user.
o If this tag is encountered when the user is not logged in, a zero (0) is returned.
· sys_portal_user_username
o Returns the username that correlates to the Portal user account for the currently logged in portal user.
o If this tag is encountered when the user is not logged in, the value “Not Logged In” will be returned.
· sys_portal_user_fullname
o Returns the Full Name that correlates to the Portal user account for the currently logged in portal user.
o If this tag is encountered when the user is not logged in, the value “Not Logged In” will be returned.
· sys_portal_user_initials
o Returns the initials (e.g. J.P.P) that correlate to the Portal user account for the currently logged in portal user.
o If this tag is encountered when the user is not logged in, the value “Not Logged In” will be returned.
· sys_portal_controls
o Returns a mini-menu containing the name of the logged in user, a link to update user information, and a logout link for the currently logged in portal user.
o Returns no data if the user is not logged in
o CSS customization:
§ The look and feel of the output can be controlled by adding a class called “.portalcontrol”. The links can be controlled through the same class names.
· sys_timemilitary
o Returns the current time in Military (24 hour time) format.
§ This is the time on the server, which is normally GMT – 07:00
· sys_timecivilian
o Returns the current time in Standard (12 hour time) format.
§ This is the time on the server, which is normally GMT – 07:00
· sys_dateshort
o Returns the current date (on the server) in the standard mm/dd/yyyy format.
· sys_datelong
o Returns the current date (on the server) in the long format.
o Example: Saturday, September 4, 2008
· sys_cururl
o Returns the URL to the currently displayed CMS webpage.
· sys_selfpid
o Returns the Page ID of the currently displayed CMS Webpage.
· sys_selflid
o Returns the Link ID of the currently displayed CMS Webpage.
· sys_whatparent
o Returns the Page ID of the Parent Page to the currently displayed CMS Webpage.
· sys_showmyname_caps
o Returns the Friendly Page Name (the Link Text), in capital letters, of the currently displayed CMS Webpage.
· sys_showmyname
o Returns the Friendly Page Name (the Link Text) of the currently displayed CMS Webpage.
· sys_showtopname_caps
o Returns the Friendly Page Name (the Link Text), in capital letters, of the top-most parent page of the currently displayed CMS Webpage.
· sys_showtopname
o Returns the Friendly Page Name (the Link Text), in proper case, of the top-most parent page of the currently displayed CMS Webpage.
Keywords that take parameters:
· sys_canvas
o Embeds the Canvas Design specified into the current CMS Webpage.
o Parameter: Canvas design name
o Example: [##sys_canvas=My Canvas##]
· sys_dynanav
o Embeds the Navigation profile specified into the current CMS Webpage.
o Parameter: Navigation profile name
o Example: [##sys_dynanav=My Navigation##]
· sys_dynanav_deadlinks
o Embeds the Navigation profile specified into the current CMS Webpage, but renders all links inoperable.
o Parameter: Navigation profile name
o Example: [##sys_dynanav_deadlinks =My Navigation##]
· sys_renderwebpage
o Retrieves the content of the specified CMS Webpage (minus the associated header and footer) and embeds it into the current CMS Webpage.
§ Great way to reuse existing content in multiple places
o Parameter: Desired page name (not the link text…the real page name)
o Example: [##sys_renderwebpage=contact_form##]
· sys_querystring_to_container
o Transfers a posted value from a form field on the previous page into a storage container which can be accessed from another CMS Webpage in the future.
o Parameters
§ Querystring Name
· The name of the form field from the previous page
§ Container Name
· The name of a container to store the value in
o If the container does not exist, it will be created
o If the container does exist, it will be overwritten
o Example: [##sys_querystring_to_container=fieldname;containerName##]
o Notes:
§ This tag returns no output, it performs the operation invisibly.
· sys_container_to_container
o Transfers a stored value from one container to another container.
o Parameters
§ Read container
· Must be a different container name than the Write container
§ Write container
· Must be a different container name than the Read container
· The name of a container to store the value in
o If the container does not exist, it will be created
o If the container does exist, it will be overwritten
o Example: [##sys_container_to_container =readContainer;writeContainer##]
o Notes:
§ This tag returns no output, it performs the operation invisibly.
· sys_set_container
o Sets the value of a container to a static value that you supply as a parameter.
o Parameters
§ Container Name
o If the container does not exist, it will be created
o If the container does exist, it will be overwritten
§ Value to store
o Example: [##sys_set_container=name:storageOne;value:John Doe##]
o Notes:
§ This tag returns no output, it performs the operation invisibly.
· sys_clear_container
o Erases a storage container
o Parameters
§ Container Name
· If the container does not exist, it will be created
o Example: [##sys_clear_container=name:storageOne##]
o Notes:
§ This tag returns no output, it performs the operation invisibly.
· sys_examine_container
o Compares the value of a container with the value passed as a parameter, and takes action based on pass/fail instructions passed as parameters.
o Parameters
§ Container Name
· If the container does not exist, it will be created
§ Value to compare
· A static value that you specify to compare against the container’s stored value
§ On Pass directive
· If the value you specify is a match with the value in the container, this is considered a pass situation. You can specify either of these outcomes:
o Redirect to another location
o Take no action
§ On Fail directive
· If the value you specify is not a match with the value in the container, this is considered a fail situation. You can specify either of these outcomes:
o Redirect to another location
o Take no action
o Examples:
§ Scenario one – Does the storage container “qualified” have a stored value (any value) or is it empty? If it contains a value, allow the user to continue viewing this webpage. If it is empty, kick the user out and send them somewhere else:
· [##sys_examine_container=name:examineMe;value:$any;onpass:$noaction;onfail:/cm/content/security_warning.asp##]
§ Scenario two – Use the storage container numerous times as a “decision tree” to send the user to a specific page based on the value of the container.
§ In this scenario, you would use this tag as many times as you need, one time for each value you are matching for a particular page redirect.
§ Note the third occurrence which directs users to one page if the container is empty, and a “catch all” page if the container is not empty but does not contain either of the two values compared in the first two occurrences.
§ When using multiple occurrences of the tag, they will be processed in the order encountered.
[##sys_examine_container=name:gender;value:female;onpass:/cm/content/for_the_women.asp;onfail:$noaction##]
[##sys_examine_container=name:gender;value:male;onpass:/cm/content/for_the_men.asp;onfail:$noaction##]
[##sys_examine_container=name:gender;value:$any;onpass:/cm/content/gender_unspecified.asp;onfail:/cm/content/choose_gender.asp##]
· sys_alertme
o Pops up an alert message on the user’s web browser if a posted condition is met
o Parameters
§ Posted query string name to read (field name from a previous page or variable placed in the URL leading to this page)
§ Value to match
§ Text for the pop-up alert
o Example: [##sys_alertme=status;1;The operation completed successfully!##]
· sys_dataview
o Embeds the specified DataView in the currently viewed CMS Webpage
o Parameters
§ DataView name
o Example: [##sys_dataview=User_Listing##]
· sys_image_rotate
o Randomly selects an image from a directory you specify, and uses that image as the source for an image in the currently viewed CMS Webpage.
o Use this tag in place of a standard image URL
o Parameters
§ Image directory
o Example: <img src=”[##sys_image_rotate=/cm/media/images/rt1##]” border=”0”>
· sys_pagejump
o Redirects the user to another webpage within the CMS or to an external location.
o Parameters (only one of the following may be used per tag occurrence)
§ CMS Webpage ID
§ CMS Webpage Name (Not the link text)
§ Absolute URL
§ Relative URL
o Examples:
§ Redirect to a CMS Webpage using the Page Name
· [##sys_pagejump=Contact_us##]
§ Redirect to a CMS Webpage using the Page ID
· [##sys_pagejump=54##]
§ Redirect to a CMS Webpage using a relative URL
· [##sys_pagejump=/cm/content/contact_us.asp##]
§ Redirect to an outside location using an absolute URL
· [##sys_pagejump=http://www.google.com##]
· sys_readvar
o Returns the value of a querystring (field value) from a previous page
o Parameters
§ Query string name
o Example
§ [##sys_readvar=first_name##]
· sys_readcmsvar
o Returns the value of a DataView query string (field value) from a previous page and strips out the DataView formatting before displaying it.
o Parameters
§ Query string name
o Example
§ [##sys_readcmsvar=first_name##]
· sys_include
o Embed the HTML output from another webpage, local or remote, in the currently viewed CMS Webpage.
o Parameters (only one of the following may be used per tag occurrence)
§ Absolute URL to a webpage
§ Relative path to an HTML document within the CMS
o Examples
§ Embedding the content from an external website:
· [##sys_include=http://www.google.com##]
§ Embedding the content from a local HTML file
· [##sys_include=/cm/media/documents/file.html##]
· sys_breadcrumb
o Displays breadcrumb-style navigation from the top-level CMS webpage to the currently viewed CMS Webpage, and all webpage levels in between.
o Parameters
§ Style class to apply to breadcrumb links
o Example: [##sys_breadcrumb=class:breadcrumb_style##]
· sys_sitemap_top
o Displays a sitemap (formatted listing of CMS WebPages & hyperlinks) containing only Top-Level CMS WebPages.
o Parameters
§ Layout
· vertical
· horizontal
§ Per Column (numeric value)
§ Style class (class name)
§ Show hidden pages (yes/no)
§ Page exclusions
· Comma separated list of CMS Webpage Names (Not link text)
o Example:
§ [##sys_sitemap_top=layout:vertical;percolumn:3;style:site_map;showhiddenlinks:yes;exclude:thank_you,site_error##]
· sys_sitemap
o Displays a sitemap (formatted listing of CMS WebPages & hyperlinks) containing only Top-Level and Child-level CMS WebPages.
o Parameters
§ Per Column (numeric value)
§ Top level Style class (class name)
§ Child level Style class (class name)
§ Show hidden pages (yes/no)
o Example:
§ [##sys_SiteMap=cercolumn:6;topstyle:site_mapTop;childstyle:site_mapChild;showhiddenlinks:no##]