Buck Anderson - DNN Professor Member Login
July 30, 2010

Article Search  
Article Categories  
View All Articles
Our Products  

Business Directory 6.1

from DNN Professor

View Details View Business Directory 6.1 Reviews

Easily add Business Directory listings to your DotNetNuke website! This, XMod powered DNN...

From: $97.00

Review IT!

from DNN Professor

View Details View Review IT! Reviews

Easily add Music, Movies, Products, Software, and Service Reviews to Your DotNetNuke website!...

From: $97.00

Move My Inventory!

from DNN Professor

View Details View Move My Inventory! Reviews

Get Results by presenting your product inventory and services in a unique and professional way...

Price: $97.00

Article Archive  
Article Index

Click to grab the RSS feed for the DNN Professor Article IndexDotNetNuke Tutorials and Articles

We cover a lot of different DNN topics on this site - this article index gives you a pretty good idea of the DotNetNuke tutorials, XMod tutorials, DNN training, DNN hosting, and Internet Marketing subjects we cover for beginners and advanced DotNetNuke users.

The following is a complete index of all articles on this site - presented in the most current to oldest article sequence. You can view categories and search the index by subject.

Check back often for new articles, tips on our Business Directory, or have articles conveniently delivered to your favorite program by clicking the RSS feed icon above.


30
DotNetNuke Text HTML Module Display Tokens and Token Replacement

 

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.

DNN Token Replacement HTMLModule Settings

Re]place tokens settings

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:

Token replacement before activating DNN token settings

Here is the same example after activating token replacement settings:

Token replacement after activating DNN token 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

Post Rating

Comments

There are currently no comments, be the first to post one.

Join the Discussion!


Buck Anderson - DNN ProfessorLet us know what you think. Or ask us anything. Or offer your own sage advice.

The only rule: RESPECT THIS HOUSE! Postings that contain abusive language and/or personal attacks will be cheerfully VAPORIZED. One cross word and – POOF! – your well-thought-out post will be gone in a puff of smoke.

          Buck

RSS comment feed RSS feed for comments on this post | Permalink URL

Note: For security, public comments require an Email address (Email will not be published and is also used for your Gravatar image)

Post Comment

Name (required)

Email (required)

Website

CAPTCHA image
Enter the code shown above in the box below



Copyright 2004 - 2010 by Jive Media Group LLC. All Rights Reserved.  | Terms of Use | Privacy Statement | Email White Listing | Site Map