Skip to main content
Version: 1.25 (Current)

Core Tokens

These are standard, Plant an App-specific tokens.

Below is a list of all Core Tokens, along with a description of the information each one them binds. Further information regarding accepted Values, case Usage and usage Examples can be found directly in the Plant an App interface, under Configuration > Tokens > Core Tokens.

TokenDescription and informationValues or syntax
HostBinds HostSettings information.[Host:<HostSetting>] - where "HostSetting" is defined in the HostSettings table.
UserBinds information about current user or the user identified by the UserId, Username, or Email parameters.
Normally, the User token returns information about currently logged in user. But My Tokens allows passing in a parameter that would determine whose information is retrieved. This can be passed as a user ID (ex: [User:FirstName(userid=111)] - outputs the first name of the user whose ID is "111"), username ([User:FirstName(username="john")] - outputs the first name of the user with username "john") or as an email address ([User:FirstName(email="john@doe.com")] - outputs the first name of the user found to have the respective email address; if more than one user has the same address, the first one is used.)
[User:VerificationCode], [User:AffiliateId], [User:DisplayName], [User:Email], [User:FirstName], [User:IsSuperUser], [User:LastName], [User:PortalId], [User:UserId], [User:Username], [User:FullName], [User:Roles]
PortalBinds information about the current portal.[Portal:Currency], [Portal:Description], [Portal:Email], [Portal:FooterText], [Portal:HomeDirectory], [Portal:LogoFile], [Portal:PortalName], [Portal:Url], [Portal:TimeZoneOffset], [Portal:CurrentLanguage]
BrowserBinds information about browser capabilities; please see here for more information.Binds HttpBrowserCapabilities properties. For example, [Browser:IsMobileDevice] evaluates to "true" when the user is using a mobile phone. General syntax: [Browser:<Key>]
MembershipBinds membership information; please see the Plant an App interface, under Configuration > Tokens > Core Tokens > Membership for information about how to enable Online Users.[Membership:Approved], [Membership:CreatedDate], [Membership:IsOnline]
ProfileBinds profile information for current user.[Profile:<ProfilePropertyName>]
TabAccess information for current tab.[Tab:Description], [Tab:EndDate], [Tab:FullUrl], [Tab:IconFile], [Tab:KeyWords], [Tab:PageHeadText], [Tab:StartDate], [Tab:TabId], [Tab:TabName], [Tab:TabPath], [Tab:URL]
PageAccess information for current page.[Page:<Value>(TabId=<number>)]
ModuleBinds information for current module.[Module:Description], [Module:EndDate], [Module:Footer], [Module:FriendlyName], [Module:Header], [Module:HelpUrl], [Module:IconFile], [Module:ModuleID], [Module:ModuleTitle], [Module:PaneName], [Module:StartDate]
DateTimeBinds DateTime information; please see the Plant an App interface, under Configuration > Tokens > Core Tokens > DateTime for accepted syntax and examples.[DateTime:Now]
TicksBinds ticks information. A single tick represents one hundred nanoseconds or one ten-millionth of a second. There are 10,000 ticks in a millisecond and 10 million ticks in a second. Please see here for more information.[Ticks:Now], [Ticks:Today], [Ticks:TicksPerDay]
RandomReturns a random value from specified comma separated list.[Random:Val1,Val2,…,ValN]
ApplicationBinds HttpApplicationState collection. Please see here for more information.[Application:<Key>]
AppSettingsBinds to the "App Settings" ("<appSettings>") from the web.config file. Please see here for more information. This token needs to be enabled from security settings.
ServerVarsBinds the Request.ServerVariables collection from ASP.NET. Please see here for more information.[ServerVars:<Key>]
SessionBinds the HttpSessionState collection; please see here for more information.[Session:<Key>]
CookieBinds HttpCookieCollection from ASP.NET. Allows to set, remove or retrieve values for cookies. Please see here for more information.[Cookie:<Key>]
GetBinds Request.QueryString collection from ASP.NET. Please see here for more information.[Get:<Key>]
QueryStringSame as above, binds Request.QueryString collection from ASP.NET. Please see here for more information.
Notes:
1. When you use this token in an SQL query, please make sure to check for valid year values. If the QueryString variable year has a generic value such as "xyz", the query will crash.
2. Always use a bind expression in your SQL data source when you use QueryString variables.
[QueryString:<Key>]
Example: the [QueryString:year="[Date:Now\|yyyy]"]0101 token will return:
- "20190101" if the QueryString variable "year" has the value "2019"
- the current year if the value is not found: "20230101"
PostBinds Request.Form collection from ASP.NET. Please see here for more information.[Post:<Key>]
ParamsBinds the Request.Params collection (GET + POST + COOKIE parameters).[Params:<Key>]
HttpContextItemsBinds HttpContext.Items property. Please see here for more information.[HttpContextItems:<Key>]
ContextItemsBinds the HttpContext.Items property - obsolete, use the "HttpContextItems" token instead (see above).
ContextBinds the HttpContext.Items property - obsolete, use the "HttpContextItems" token instead (see above).
SetSessionSets a value in the server session.[SetSession:<Key>=val]
Note: SetProfile, SetSession and SetCookie tokens are write only. They always return empty strings. Use other forms below if you need to return values.
SetCookieSets a certain cookie value on the user's browser (along with its expiry).[SetCookie:<Key>=val]
Note: SetProfile, SetSession and SetCookie tokens are write only. They always return empty strings. Use other forms below if you need to return values.
SetProfileSets a value in the user's profile.[SetProfile:<Key>=val]
Note: SetProfile, SetSession and SetCookie tokens are write only. They always return empty strings. Use other forms below if you need to return values.
GetOrSessionBinds the Request.QueryString collection just like the Get token (see above) does. These are special tokens that interrogate two sources for content and synchronizes them. If the <Key> exists, it is saved it into the Session. Once the user leaves the page, this token will return the saved value from the Session.[GetOrSession:<Key>]
When invoking the "[GetOrSession:MyParam]" token, the following algorithm runs:
1 - If "MyParam" exists in GET, the value will be saved in "Session:MyParam" and the value returned.
2 - If MyParam doesn't exist in GET, it will check "Session:MyParam": if it exists, it will return its value; if doesn't exist, it will return default value or an empty string.
GetOrCookieBinds the Request.QueryString collection just like the Get token (see above) does. These are special tokens that interrogate two sources for content and synchronizes them. If the <Key> exists, it is saved it into the browser's cookies. After the user leaves the page, this token will return the saved value from the cookies.[GetOrCookie:<Key>] - see also the example above.
GetOrProfileBinds the Request.QueryString collection just like the Get token (see above) does. These are special tokens that interrogate two sources for content and synchronizes them. If the <Key> already exists, then it saves it into the User Profile under the property with the same name (must be created before the token is invoked). Once the user leaves the page, this token will return the values saved in the User Profile.[GetOrProfile:<Key>]- see also the example above.
PostOrSessionBinds the Request.Form collection just like the Post token (see above) does. These are special tokens that interrogate two sources for content and synchronizes them. If the <Key> already exists, then it saves it into the Session. Once the user leaves the page, this token will return the saved value from the Session.[PostOrSession:<Key>] - see also the example above.
PostOrCookieBinds the Request.Form collection just like the Post token (see above) does. These are special tokens that interrogate two sources for content and synchronizes them. If the <Key> already exists, then it saves it into the browser's cookies. Once the user leaves the page, this token will return the saved value from the cookies.[PostOrCookie:<Key>] - see also the example above.
PostOrProfileBinds the Request.Form collection just like the Post token (see above) does. These are special tokens that interrogate two sources for content and synchronizes them. If the <Key> already exists, then it saves it into the User Profile under the property with the same name (must be created before the token is invoked). Once the user leaves the page, this token will return the values saved in the User Profile.[PostOrProfile:<Key>] - see also the example above.
ProfileOrInitBinds a Profile Property. If the profile property doesn't have a value, it will get updated to the value in the InitValue parameter (which can be a token itself). The behavior is similar to previous tokens, except these initialize a setting if it doesn't exist by using a value provided through a parameter. In other words, they are basically a generalization of tokens above.[ParamOrSession:<Key>]
Usecase example: for the token [SessionOrInit:<Key>(InitValue="<My Initial Value>")], if the <Key> already exists in the present session, the "InitValue" is ignored, unless you specify the "UpdateAlways" parameter, with its value set to "true": [SessionOrInit:<Key>(InitValue="<My Initial Value>", UpdateAlways=true)]
SessionOrInitBinds a value from server session. If the server session doesn't contain a property with given <key>, it will get updated to the value in the InitValue parameter (which can be a token itself). The behavior is similar to previous tokens, except these initialize a setting if it doesn't exist by using a value provided through a parameter. In other words, they are basically a generalization of tokens above.[ParamOrCookie:<Key>]- see also the example above.
CookieOrInitBinds a value from the browser's cookies. If the browser cookies don't contain a property with given <key>, it will get updated to the value in the InitValue parameter (which can be a token itself).The behavior is similar to previous tokens, except these initialize a setting if it doesn't exist by using a value provided through a parameter. In other words, they are basically a generalization of tokens above.[ParamOrProfile:<Key>] - see also the example above.
UserRolesProvides access to membership for current user. Please see the Plant an App interface, under Configuration > Tokens > Core Tokens > UserRoles for accepted syntax.Offers access to the roles assigned to current users: [UserRoles:All] (returns comma separated string with all of the current user's roles).
URLProvides access to information about current URL: Domain(e.g. "example.com"), Port (e.g. "80"), DomainRoot(e.g. "https://example.com"), FullUrl(e.g. "https://example.com/page"), Relative (e.g., "/page"), Referrer, PageName(e.g. "PageName.aspx"), PageNameWithoutExtension(e.g. "PageName"), Query, RewrittenQuery.[Url:Domain], [Url:Port], [Url:DomainRoot], [Url:FullUrl], [Url:Relative], [Url:PageName], [Url:PageNameWithoutExtension], [Url:Referrer], [Url:Query], [Url:RewrittenQuery]
NavigateURLHelps build URLs from the page id or the page path. This token computes a portal URL give a tab id or tab path. For example [NavigateUrl:123] or [NavigateUrl:/mypage]. This is very useful when having to hardcode portal URLs in various places like HTML modules, so for example when page hierarchy or page names change, the URLs propagate automatically.This is normally used inside href attributes of the HTML links.
[NavigateUrl:<tab id>], [NavigateUrl:<tab path>]
MD5Returns the MD5 hash of any text.
Base64Encodes and decodes text in Base64.[Base64:Encode(Value='<encode string>')], [Base64:Decode(Value='<base64 string>')]
EncodeSQLEncodes a text against SQL injection - obsolete, use the "SQL" token instead (see below).
SQLEncodes a text to protect against SQL injection attacks.[SQL:Encode(Value='<sql string')]
GUIDGenerates a new GUID (*Globally Unique IDentifier*, a 128-bit text string that allows unique application identification).The two different forms allow you choose between having hyphens or not: "03311958-433f-4d7e-bd2d-086f8c07621f" or "03311958433f4d7ebd2d086f8c07621f".
[Guid:New], [Guid:NewCompact]
SiteAdminBinds information about administrator of current portal. This has the same properties as the "[User:*]" token. Please see the Plant an App interface, under Configuration > Tokens > Core Tokens > SiteAdmin for accepted syntax.[SiteAdmin:<user property>]
PortalSettingsBinds PortalSettings information (gets settings as defined in the PortalSettings table).
HasRoleChecks that the current user has the given role. By default, these tokens return "true" or "false", but they can be adjusted using the format specified and default value to return something else.[HasRole:<RoleName>]
DoesNotHaveRoleChecks that the current user does not have the given role. By default, these tokens return "true" or "false", but they can be adjusted using the format specified and default value to return something else.[DoesNotHaveRole:<RoleName>]
ModuleOutputRenders the given module and embeds it where the token appears. This token pulls the content of a module identified by its module ID to embed them at current location. The module is fetched using the an HTTP request to the module print page. As such, make sure the application pool is allowed to make HTTP requests to itself (sometimes the DNS is not configure properly on the machine, which can't resolve itself). To implement a caching strategy, create a custom Constant Token and use this token within the definition of the constant token. This will give you all the caching options that custom tokens have.[ModuleOutput:<module id>]
DoMathReturns the result of a mathematical expression. Accepts tokens as values. Returns the result of a mathematical expression. For example: "[DoMath:Eval(expression=1+6-2)]" will return "5". Please see the Plant an App interface, under Configuration > Tokens > Core Tokens > DoMath for further examples and accepted syntax.[DoMath:Eval(expression=<expr>)]
IfCompares two variables and displays True if they are equal. This token is particularly useful in Condition fields. For example: [If:Eq(a="test", b="test")] will return "true"; If:DisplayIfNotEmpty returns a text when a condition is not empty.[If:Eq(a="...", b="...")], [If:Equals(a="...", b="...")], [If:DisplayIfNotEmpty(Condition = "", DisplayText = "show this")]
StringEvaluates a string and replaces a predefined expression with the specified value(s). Example: [String:Replace(Input="25 feb 2023", Match="25", Replacement="01")] will return "01 feb 2023". Also works with "RegexMatch" (ex: [String:RegexMatch(Input="25 feb 2015",Match="\d{2}")] returns "25"), "RegexReplace" (ex: [String:RegexReplace(Input="25 feb 2023", Match="\d{2}", Replacement="01")] will return "01 feb 0101") and "Substring" (ex: [String:Substring(Input="25 feb 2023",Start=0,Length=2)])).[String:Replace(Input=<text>, Match=<text>, Replacement=<text>)], [String:RegexReplace(Input=<text>, Match=<text>, Replacement=<text>)], [String:RegexMatch(Input=<text>, Match=<text>)], [String:Substring(Input=<text>, Start=<number>, Length=<number>)]
DebugProvides access to debugging functions (dumps all parameters on screen).
FreeGeoIpProvides geographical information based on IP address. Accepts IPv4 and IPv6.There is a list of tokens that return the Geo IP location using Free Geo IP service: [FreeGeoIp:CountryCode], [FreeGeoIp:CountryName], [FreeGeoIp:RegionCode], [FreeGeoIp:RegionName], [FreeGeoIp:City], [FreeGeoIp:ZipCode], [FreeGeoIp:TimeZone], [FreeGeoIp:MetroCode], [FreeGeoIp:Latitude], [FreeGeoIp:Longitude].
ResponseModifies the HTTP response to include headers and sets page title. Accepts tokens as values.[Response:AddHeader(name="Header Name", Value="Header value")],[Response:SetTitle(text="Page Title")]
"AddHeader" will append a header to the HTTP Response, while "SetTitle" will override a page's title.
PluralizationHelper tokens for content pluralization (allows to define plural values for specific words or expressions).
LocalizationHelper tokens for content localization. Retrieves localization information from the browser. Accepted values: BrowserCultureCode, BrowserLanguageCode, BrowserCountryCode.
FileGets the link for a file that exists on the current portal.
FolderSynchronizes the folders on the current portal.