Buck Anderson posted on November 30, 2009 13:43 :: 2613 Views

In this article, I will explain how you can easily personalize your DNN portal by using token replacement in your Text/HTML module.
Background:
Beginning with DotNetnuke version 4.6.0 Token replacements were introduced for use with the Text/HTML module (in version 5+ it is simply called the HTML module) that is available with DotNetnuke.
This feature provides a MUCH needed enhancement to the Text/HTML Module and is something that I think many DotNetNuke users will find to be very helpful.
What Does It Do?
With the introduction of tokens, you can now personalize your content in the HTML module. DotNetNuke has given us access to an abundance of tokens that we can now use within our content (Token List below).
Using the tokens is VERY simple you can use the tokens in your website content just like you would use them in other areas that support DNN tokens. As an example: for the portal name you will use [Portal:PortalName]. If you would like to welcome a logged in user you can easily add [User:DisplayName], [Profile:FirstName] or [User:FirstName] to your content.
After all, we are all human beings and by nature the most important word we enjoy seeing in print is our name.
How Does It Work?
You can access the token processing settings via the "Settings" option from the module's action menu, below is a screencapture of the settings available.

![Re[place DNN tokens settings Re]place tokens settings](/Portals/0/ArticleImages/Buck-Anderson/Tokens-replace-html-module.png)
After updating your module settings you are now ready to use tokens.
Here is an example of how tokens would look prior enabling token settings:

Here is the same example after activating token replacement settings:

You may also supply an optional format to the token after the name of the property if you use a | character delimiter. In the example above, I have used the pipebar character (|) to inject the token, [Profile:FirstName|, into a sentence.
Profile:FirstName|Welcome, {0}...
The {0} tells the token engine to put the value for that token within the sentence. Thus resulting in Welcome and the users profile FirstName.
Give it a try and please share your comments below.
Token Descriptions:
Portal
]Portal:Currency[ Currency String
]Portal:Description[] Portal Description
[Portal:Email] Portal Admin Email
[Portal:FooterText] Portal Copyright Text
[Portal:HomeDirectory] Portal (relative) Path of Home Directory
[Portal:LogoFile] Portal Path to Logo file
[Portal:PortalName] Portal Name
[Portal:PortalAlias] Portal URL
[Portal:TimeZoneOffset] Difference in minutes between Portal default time and UTC
User
[User:DisplayName] User’s Display Name
[User:Email] User’s Email Address
[User:FirstName] User’s First Name
[User:FullName] [deprecated]
[User:LastName] User’s Last Name
[User:Username] User’s Login User Name
Membership
[Membership:Approved] Is User Approved?
[Membership:CreatedDate] User Signup Date
[Membership:IsOnline] Is User Currently Online?
Profile
[Profile:property] Use any default or custom Property defined for user profiles as listed in Profile Property Definition section of Manage User Accounts. Please use non-localized Property titles only.
Tab
[Tab:Description] Page Description Text for Search Engine
[Tab:EndDate] Page Display Until Date
[Tab:FullUrl] Page Full URL
[Tab:IconFile] Page Relative Path to Icon file
[Tab:KeyWords] Page Keywords for Search Engine
[Tab:PageHeadText] Page Header Text
[Tab:StartDate] Page Display from Date
[Tab:TabName] Page Name
[Tab:TabPath] Page Relative Path
[Tab:Title] Page Title (Window Title)
[Tab:URL] Page URL
Module
[Module:Description] Module Definition Description
[Module:EndDate] Module Display Until Date
[Module:Footer] Module Footer Text
[Module:FriendlyName] Module Definition Name
[Module:Header] Module Header Text
[Module:HelpUrl] Module Help URL
[Module:IconFile] Module Path to Icon File
[Module:ModuleTitle] Module Title
[Module:PaneName] Module Name of Pane where UDT resides
[Module:StartDate] Module Display from Date
Date
[DateTime:Now] Current Date and Time
[Ticks:Now] CPU Tick Count for Current Second
[Ticks:Today] CPU Tick Count since Midnight
[Ticks:TicksPerDay] CPU Ticks per Day (for calculations)
For date/time and numeric values, you can also append a form "format" string defined by the .Net framework, for example: [DateTime:Now|"format"] current date/time formatted according to "format", e. g. [DateTime:Now|f] displays current date in short format (does not apply to expressions of calculated columns)
Wishing you success,
Buck