Syntax Guide

Article number: 300866

Reserved or Magic Words

All the following are invoked by encasing the relevant word in triple colons eg :::word:::

Magic word

Description

:::date.long:::

IIS web server date (typically DD/MM/YYYY).

:::time:::

IIS web server time.

:::month:::

IIS web server date month.

:::day:::

IIS web server day.

:::monthname.long:::

IIS web server date month name as long format

:::monthname.short:::

IIS web server date month name as short format.

:::year:::

IIS web server date year.

:::dayofweek:::

IIS web server date day of week.

:::dayofweek.nr:::

IIS web server date day of week as hash code.

:::date:::

IIS web server date formatted as DD Month YYYY

:::datestring:::

IIS web server date as continuous string eg 20131202 for 2nd December 2013

:::datetimestring:::

IIS web server time and date as continuous string eg 201312021115

:::timestring:::

IIS web server time as continuous string eg 1115 for 11:15

Page or Asset Information

Magic word

Description

:::classid:::

The ID of the asset class applied to the page.

:::classname:::

The name of the asset class applied to the page.

:::length(magic-word):::

The length magic word is used to return the length of a string returned by another magic word. For example, :::length(username)::: would return 10 – assuming the user's name contained 10 characters.

:::textonly:::

URL to the text only version of the page.

:::mobileswitch:::

URL to the mobile/desktop version of the page

:::xmlversion:::

URL to the XML version of the page.

:::printthispage:::

URL to the print version of the page.

:::changelang:::

Inserts necessary code to change language in multilingual pages.

:::lang:::

The pages language identifier of the current site eg ‘FR'

:::lorem###:::

where ### is an integer. Inserts the integer number of character of space filler text in page.

:::title:::

Page title.

:::editorialtitle:::

Page title.

:::currentpageeditorialtitle:::

Page title.

:::menutitle:::

Page title for menu.

:::menueditorialtitle:::

Page title for menu.

:::promokeyword:::

Page name.

:::requestpromokeyword:::

Page name.

:::lastupdatedby:::

User who last updated page.

:::lastupdated:::

Date and time page last updated.

:::lastupdated.shortdate:::

Date page last updated.

:::lastupdated.longdate:::

Date page last updated.

:::lastupdated.shorttime:::

Time page last updated.

:::lastupdated.longtime:::

Time page last updated.

:::parentpageinfo.<level>.<fielddisplayed>:::

or
:::pageinfo.<shortcutid>.<fielddisplayed>:::

or
:::thispageinfo.<fielddisplayed>:::

or
:::parentpageinfo.asc.<level>.<fielddisplayed>:::

(find more information on each below)

Displays information about the current page. Valid fielddisplayed options are shown below and are used repeatedly for various identifiers.

fielddisplayed

What it does

title

Page Title

navtitle

Navigation Title

absurl

Using RESTful URLs (10.5)

relURL

Using RESTful URLs (10.5)

summary

Page Summary

summaryimagepicid

Returns the picid for the page summary image.

datelastmodified

Date last modified

lastmodifiedby

Person who last modified it

order

Sort order of the items within the navigation structure at that level. Includes pages hidden from navigation.

ordinal

Ordinal value to the above but where order present the sortOrder pulled from the DB the ordinal is always a 1,2,3,4 order of navigation branches with no gaps. Hidden pages are not included but pages in the recycle bin are similar.

bodyX

Where X is the body number. Outputs the contents of a BODY block.

bodylengthX

Where X is the body number. Outputs the number of characters in a BODY block.

picidX

Where X is the pic number. Outputs the Asset Link ID.

picurlX

Where X is the pic number. Outputs the URL (if link) field.

picurltargetX

Where X is the pic number. Outputs the Target for URL field.

picattributesX

Where X is the pic number. Outputs the cropping settings as querystring parameters (e.g. &cropright=5)

shortcutid

displays the shortcutid of the identified page.(10.4)

picpathX

Where X is the pic number. Outputs the path of the image (added in 10.5).

piccaptionX

Where X is the pic number. Outputs the alt/caption of the image.

:::pageinfo.<shortcutid>.<fielddisplayed>:::

See above for fielddisplayed options. Displays information about the current page. Valid fields are described in the fielddisplayed table shown above. Note: None of the pageinfo, or parentpageinfo or thispageinfo prefixed syntax will return valid values for virtual pages as these are only 'pointers' to where the real content is.

:::thispageinfo.<fielddisplayed>:::

See above for fielddisplayed options. Displays information about the current page. Valid fields are described in the fielddisplayed table shown above. Note: None of the pageinfo, or parentpageinfo or thispageinfo prefixed syntax will return valid values for virtual pages as these are only 'pointers' to where the real content is

Parent or ancestor IDs

:::parentpageinfo.asc.<level>.<fielddisplayed>:::

This is an addition for thispageinfo, parentpageinfo, pageinfo magic words. Like bodyX, could be ancestorX (ancestor1 = parent, ancestor2 = grandparent), e.g. parentpageinfo.asc.1.navtitle would show the current pages, parent page nav title. See above for fielddisplayed options.

:::parentpageinfo.<level>.<fielddisplayed>:::

See above for fielddisplayed options. Displays information about the current page. Valid fields are described in the fielddisplayed table shown above. Note: None of the pageinfo, or parentpageinfo or thispageinfo prefixed syntax will return valid values for virtual pages as these are only 'pointers' to where the real content is.

:::assetfullpath.shortcutid-<shortcutid>:::

Displays the full path of the asset with the specified shortcutid. See example at bottom of table.

:::showfrom:::

Page show from date.

:::showfrom.shortdate:::

Page show from date.

:::showfrom.longdate:::

Page show from date.

:::showto:::

Page show from date.

:::showto.shortdate:::

Page show from date.

:::showto.longdate:::

Page show from date.

:::editorialid:::

Editorial ID of page.

:::shortcutid:::

Shortcut ID of page.

:::assetid:::

Asset ID of page.

:::pagepath:::

Concatenated string representing the path from the current page name to the root using the promokeyword. Each pagename is separated by a dot, all ‘.html's are removed, all slashes (/) are replaced by a dot ie home.forums.forum.

:::pagepath_lower:::

Concatenated string representing the path from the current page name to the root using the promokeyword in lower case. Each pagename is separated by a dot, all ‘.html's are removed, all slashes (/) are replace by a dot.

:::urlpagepath:::

Same string treatment as above except it only produces the page name alone, ie forum.

:::summary:::

Page summary.

:::autosummary:::

Page auto summary.

:::protocol:::

The protocol the page is being served on. eg https

:::pdomain:::

The protocol and domain the page is being served on. eg https://helpcms.sitekit.net

:::domain:::

The domain the page is being served on. eg helpcms.sitekit.net

:::subdomain:::

The sub domain the page is being served on. eg helpcms

:::uri:::

Complete web address of the page

:::category:::

For use on a page displaying a single news article (both types of news work). It displays the category of the relevant article as defined in its RSS. If the word is used on a news page then it displays a comma separated list of the unique categories applied to the displayed news items.

Zone related
:::zone.myzonename.count:::

Where 'myzonename' is the name of a zone on the page. Used to identify whether a page zone contains editable elements and could be taken advantage of using conditionals to remove wrapper markup when zones are empty. Added in 11.0

Embedding forms.
:::form-formname:::
:::form-formid:::

It accepts either the form name or the formID number, n.b. if the form name contains no alphabetic characters then you have to use the formID number. Only works for v2 and v3 forms. Added in 11.1.

Presence of page blocks. :::thispageinfo.hasinternallinks:::
:::thispageinfo.hasexternallinks:::
:::thispageinfo.hasdownloads:::

Used to identify whether a page has the specific blocks and could be taken advantage of using conditionals.

:::metadata.keywords:::

Displays the metadata keywords applied to this page.

:::metadata.description:::

Displays the metadata description applied to this page.

:::metadata.<fieldname>:::

Displays the additional metadata value for the fieldname in question for this page. The fieldname used to call any additional metadata is whatever is inside the <NAME></NAME> tags in the relevant additional metadata scheme.

:::fileinfo.<shortcutid>.<field>:::

Mainly intended for returning information about a .pdf file held in the file library, via the asset's shortcut id.

shortcutID is the integer shortcut id of the asset.

The field options are as follows:

Field

Description

:::name:::

The filename field from the file downloads table

:::created:::

The created date field from the file downloads table.

:::summary:::

The summary field from the file downloads table

:::mimetype:::

The mime type from the file downloads table.

:::modified:::

The date and time on which the file was last modified.

:::displayname:::

The displayname field from the file downloads table.

:::size[-<k|mb>.<dp>]:::

The size from the file downloads table in bytes, optionally in 'k' or 'mb' and an integer number of decimal places, e.g. 'size.mb.2' for megabytes to 2 dp. (from V12).

For example, the following will present a dynamic link using the displayname for the file followed by it summary using only the shortcutid;

<p>
	<a href=":::assetfullpath.shortcutid-450808:::" target="_blank">
		:::fileinfo.450808.displayname:::
	</a>
	:::fileinfo.450808.summary:::
</p>

Note: The asset can only be a file in the file library. It won't work on page assets. It will only get the data for the current ‘active' version of the file, and won't return information if the file is in the bin.

You can use this syntax to render an image in an xsl say from its passed in shortcut id eg

<img alt="{FullName}" src="###assetfullpath.shortcutid-{picshortcutid}###"/>

If bodyX exists on the specified page (specified by editorialid and lang or pageParentlevel) then it is returned (or else a blank string is returned). The presence of text can also be checked by testing whether bodylengthX>0 The attributes and attribute vales are all case sensitive. If the summary field is blank autosummary is used. For example

<sitekit:info pageEditorialid="009001" lang="EN" fielddisplayed="navtitle" />

<a href="<sitekit:info fielddisplayed="absurl" pageParentlevel="1" />">Home page</a>

<a href="<sitekit:info fielddisplayed="absurl" pageParentlevel="2" />">Ians page</a>

System Variable Alternative

Alternatively similar functionality is available using the following system variables where the fieldname argument is taken from the bullet list above.

:::pageinfo.<editorialid>.<lang>.<fielddisplayed>:::

:::pageinfo.<shortcutid>.<lang>.<fielddisplayed>:::

:::parentpageinfo.<level>.<fielddisplayed>:::

:::thispageinfo.<fielddisplayed>:::

User Specific/Extranet Information

Magic word

Description

:::username:::

User's Username.

:::fullname:::

User's full name.

:::telephone:::

User's telephone.

:::fax:::

User's fax.

:::email:::

User's email

:::job:::

User's job title.

:::department:::

User's department.

:::notes:::

User's notes.

:::lastloggedontoextranet:::

User's last logged into extranet date time.

:::usergroupid:::

User's group id.

:::peopleid:::

User's unique identifier.

:::usergroupcsv:::

Returns a comma separated list of all the user Group ID numbers that a user belongs to. For use with ‘overlaps' operator.

:::usergroupnamecsv:::

Comma separated list of the multiple group the logged in user is in so would return "admin,editor,publisher" . For use with ‘overlaps' operator.

:::sessionid:::

User's session.

:::trackerate:::

User's refID from the trackerate cookie.

:::userexpiry:::

User's expiry date.

:::address1:::

User's address1

:::address2:::

User's address2

:::town:::

User's town

:::county:::

User's county

:::country:::

User's country

:::postcode:::

User's postcode

:::avatar:::

returns the url path of the avatar pic

:::dob:::

returns dob in format 01/01/1111

:::dob.[pattern]:::

returns dob in any format required using patterns described at:
http://www.geekzilla.co.uk/View00FF7904-B510-468C-A2C8-F859AA20581F.htm e.g. :::dob.dd/mm/yyyy:::, :::dob.dd-mm-yyyy::: or :::dob.dddd, dd mmmm yyyy:::

User Personalisation Information

The same applies for user groups using the custom user group system variables below.

Magic word

Description

:::user_custom1:::

User custom 1.

:::user_custom2:::

User custom 2.

:::user_custom3:::

User custom 3.

:::user_custom4:::

User custom 4.

:::user_custom5:::

User custom 5.

:::user_custom6:::

User custom 6.

:::group_custom1:::

Group custom 1.

:::group_custom2:::

Group Custom 2.

:::group_custom3:::

Group Custom 3.

:::group_custom4:::

Group Custom 4.

:::group_custom5:::

Group Custom 5.

:::group_custom6:::

Group Custom 6.

Conditional System Variables

It is possible to insert the values into a sentence. However, if the user logged in does not have information in one of the fields that data is being called from, or they are just not logged in then it is best if the sentence does not display (as the system variable would not display). Use the following code to check that there is information in the user field in question and if the information is missing then the sentence will not be displayed.

<customtext required="fullname,user_custom1">Welcome . Your star sign is </customtext>

Put the required fields in the ‘required' attribute of the customtext tag, separating them with commas (no spaces). Then if the user does not have an entry in the ‘fullname' field then the sentence will not be displayed.

Site Information

Magic word

Description

:::sitename:::

Site name. (10.5)

:::siteid:::

Site ID.

:::sitelastupdated:::

Site last updated date time.

:::sitelastupdated.shortdate:::

Site last updated short date.

:::sitelastupdated.longdate:::

Site last updated long date.

:::sitelastupdated.shorttime:::

Site last updated short time.

:::sitelastupdated.longtime:::

Site last updated long time.

:::googleanalyticsid:::

The Google Analytics ID as entered in Site settings, it's embedded automatically in the google-analytics js block in script manager (introduced in 10.2).

:::googlemapsapikey:::

The Google Maps API key as entered in Site settings (10.3).

:::basicauth:::

Returns 'true' if Basic Authorisation is enabled for Sitekit CMS APIs (v12).

Client Environment Information

Magic word

Description

:::clientos:::

The clients operating system as derived from the browser request object.

:::clientbrowser:::

The clients operating system as derived from the browser request object.

:::clientip:::

The clients IP as derived from the Server variables object.

:::countryfromip:::

The country of origin of the page request based on the request IP address.

:::countrycodefromip:::

The country of origin of the page request based on the request IP address.

:::webcrawler:::

A Boolean representing whether the browser is a crawler as derived from the Server variables object.

:::user_agent:::

The entire user_agent string being used by the client, see example on conditionals, used for browser sniffing.

:::referrerurl:::

The URL where the link was clicked to come here derived from the Server variables object.

:::servervariables.xxx:::

Where xxx is the relevant server variables name e.g :::servervariables.server_port ::: Added in 10.3

:::formparameters:::

Any name variable pairs being passed as a post.

:::formparameters.<parameter name>:::

Return value from element specified in [parameter name] posted form. Equivalent to Request.form.item([parameter name]).

:::querystringparam:::

Any name variable pairs being passed in the URL as a get.

:::querystringparam.<parameter name>:::

Return value from element specified in [parameter name] get form. Equivalent to Request.querystring.item([parameter name]).

:::cookie.cookiename:::

Displays the relevant cookie value when extracted by its name.

:::allowcookies.x:::

Displays a boolean value that outputs whether the user has consented to cookies or not to the cooke class. (11.3)

  • 0 = Essential (Login session cookies)
  • 1 = Functional (Where we remember choices for next time)
  • 2 = Tracking (Our tracking and Google Analytics)
  • 3 = Other (None of the above)

This state is managed by the AcceptCookies cookie which will contain the numbers the user has consented to.

System Information

Magic word

Description

:::sitekitversion:::

Sitekit CMS version used to serve webpage from web.config file.

:::iistimestamp:::

IIS web server full time when webpage was served.

:::iisversion:::

IIS web server version that served the webpage.

:::serverip:::

IIS web server IP address that served the webpage.

:::servermachinename:::

IIS web server name that served the webpage.

:::dotnetversion:::

IIS web server version of Microsoft .Net that served the webpage.

:::responsetime:::

IIS web server time took to generate webpage in milliseconds.

:::responsetimesec:::

SQL Server live server response time in seconds.

:::sqlresponsetime:::

SQL server live server response time in milliseconds.

:::sqlresponsetimesec:::

SQL server live server response time in seconds.

:::sqltimestamparchive:::

SQL Server archive server time stamp when data was served.

:::sqltimestamplive:::

SQL Server live server time stamp when data was served.

:::sqlversion:::

SQL Server live server version.

:::sqlversionarchive:::

SQL Server archive server version.

Forum email formatting

The following are related to formatting of email responses in forums in 10.2

Magic word

Description

:::site.name:::

Site name

:::discussion.name:::

Forum discussion name

:::discussion.body:::

Forum initial post body text

:::discussion.owner.fullname:::

Discussion owners full name

:::discussion.owner.email:::

Discussion owners email

:::comment.owner.fullname:::

Forum commenters full name

:::comment.owner.email:::

Forum commenters email

:::comment.body:::

Body text of the comment

:::posttype.name.singular:::

Posttype singular

:::posttype.name.plural:::

Posttype plural


User store

The following relate to values set and retrieved from the user store , populating and retrieving values is done via the SecureUserStore.asmx web service documented here.

Magic word

Description

:::secureuserstore-xxx:::

Retrieval of any item placed in the user store where 'xxx' is the name given to the value

Relating to Federated logins

The following are related to federated authentication

Magic word

Description

:::federated-login:::

the federated login start point. (10.2)

:::federated-logout:::

the federated login end point. (10.2)


Relating to autologins

The following are related to registration and auto-login but they can be used in other contexts

Magic word

Description

:::errormessage:::

returns the error message from the resulting login attempt. (10.2)

:::loggedin:::

returns a true or false whether the current user is logged in. (10.2)

'Magic' get

Magic word

Description

::[get-http://:::domain::::::assetfullpath.shortcutid-761164:::]::

rather than returning a textual link to the asset this will return the asset itself.


Encoding Magic word (triple colon) syntax for front end display

This is for adding magic words in front end forums or help pages like this, when you want to display the syntax rather than have the page interpret the syntax. (10.2)

Magic word

Description/effect

<code>:::domain:::</code>

Displays the triple colon notation itself rather than interpreting it, eg :::domain:::

:::magic-<any magic word syntax>:::

Displays the triple colon notation itself rather than interpreting it, eg :::<any magic word syntax>:::



'Magic' comments

This is for adding commentary via HTML comment to the markup, all such comment are stripped out for presentation but can be read via debug. (10.4)

Magic word

Description/effect

<--- text inside comment --->

All content inside the comment <--- ---> is removed from front end visible pages unless the skdebug flag is used


Functional or Misc Magic words

These magic words do not return anything, instead they instruct the system to do something.

Magic word

Description/effect

:::include-<group name>:::

Adds the specified group of items from the script manager. (10.2)

:::themeid:::

Needed only for the script manager link that returns the id of the stylesheet that is assigned to the page in page properties (10.4)

:::postid:::

The ID of the post entry being viewed.

Magic Word Pre-Replacement in XSL

When magic words are used in XSL files as part of data islands, the magic words are normally replaced after the XSL transform has taken place. It is possible to insert the prefix 'pre-' into a magic word within an XSL file to have it replaced before the XSL file is passed to the XSL transform. This allows the XSL to access the value of the magic word, instead of seeing the magic word itself.

<xsl:if test="':::pre-protocol:::' = 'https'">protocol magic word pre-replaced!</xsl:if>

Related questions