You need to Register for free and Login to post a message in the forum.

Forum

Subject: Replace Tokens w/ HTML Module
Prev Next
You are not authorized to post a reply.

Author Messages
ImageSmith
Nuker
Nuker
Posts:11


13 Nov 2007 1:10 PM  

I have recently discovered the HTML Setting that allows for replacement of tokens in version HTML_04.07.00_Install.zip.


HTML module settings for dynamic replacement of tokens

I can get the following TOKENS to work

  • [USERisplayName] renders the user's display name
  • [PORTALescription] renders the portal's description text
  • [TABescription] renders the current tab's description text
  • [MEMBERSHIP:LastLoginDate] renders the user's last login datetime
  • [Profile:Biography] renders the richtext from the user's Biography profile option


Does anyone know where I can get more resources on this topic?
If you know more tokens I could use please post them in a reply.



EXAMPLE USE

User based color themes

I created a Profile Property named theme of type "list" with three options (red, green, blue)

In the settings for an text/html module, I ticked the Replace Tokens option and clicked update.
In the source view for the text html module I included something like this: 


The token is replaced with the profile data specific to the logged in user, the div is assigned a class name of whatever the value of the user's Theme profile option (red, green, blue)

Then I created CSS rules for the options I selected in the profile...

In the portal.css file I added the following:


So if I set my Theme profile to red, the text in the module will render as red.

Pretty Neat!


Earning our stripes... everyday.
imagesmith.com
jncraig
DNN Creative Staff
Nuke Master III
Nuke Master III
Posts:3750


13 Nov 2007 2:00 PM  
Mitchel Sellers has a blog entry about the replaceable tokens here.  One of the comments tells you how to find a list of tokens in, of all places, the settings for the User Defined Table module.

I haven't explored this issue in great detail, but your use of a profile entry to specify a class is really clever!

Joe Craig
DNN Creative Support
Subscribe to the website
jncraig
DNN Creative Staff
Nuke Master III
Nuke Master III
Posts:3750


13 Nov 2007 2:52 PM  
Here is the complete list (I've edited in spaces between the colon and the text so that they won't be interpreted/displayed as emoticons):

Token Description
[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: 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: Approved] Is User Approved?
[Membership: CreatedDate] User Signup Date
[Membership: IsOnline] Is User Currently Online?
   
[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: 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: 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
   
[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)
</form>

Joe Craig
DNN Creative Support
Subscribe to the website
ImageSmith
Nuker
Nuker
Posts:11


13 Nov 2007 3:17 PM  
Thanks for your feedback.

There is also support for TOKENS in the Newsletter/BulkEmail Module...

http://www.dotnetnuke.com/Community/Blogs/tabid/825/rssentryid/1552/Default.aspx


I would like to use this replacement method in a major project that involves Variable Data Printing (VDP), mail marketing, and personal web pages. The goal is to provide clients with reports and data from the marketing campaigne.

Printing on each piece of mail is personalize content, which includes a personal url where the recipient could go and give feedback or to access services or coupons, or what ever. This information is printed on a mail piece (post card, etc...) and mailied via USPS.

If anyone has any ideas, I would love to hear them.

Earning our stripes... everyday.
imagesmith.com
leesykes
DNN Creative Staff
Nuke Master III
Nuke Master III
Posts:3960


13 Nov 2007 4:53 PM  
Hello,

The tokens have been set up so that you can place them in any module. While I was at Las Vegas I interviewed Sebastian Leupold who looks after the UDT module and tokens code and had a good chat with him covering these elements, so if you need tips on implementing the tokens within a module it could be worth asking details in the UDT module project forum.

Let us know how you get on and post any examples of code if you get them,

Thanks,

Lee Sykes
Site Administrator
Subscribe to the website : DotNetNuke Video Tutorials : The Skinning Toolkit : DotNetNuke Podcasts

Twitter: www.twitter.com/leesykes

Lee Sykes's Facebook Profile
bamboo
Nuke Newbie
Nuke Newbie
Posts:2

20 Nov 2007 7:22 AM  
A couple more tokens not listed above that work okay in 4.7.0 newsletters:
[Host: HostTitle]
[Portal: PortalName]
[Date: Current] in addition to [DateTime: Now] (remove spaces after colons)

I can't use Tokens in Text/HTML yet, as after upgrading to DNN 4.7.0, the Text/HTML module is still version 04.05.00 and I can’t see HTML_04.07.00_Install.zip on Sourceforge?

Jeff

jncraig
DNN Creative Staff
Nuke Master III
Nuke Master III
Posts:3750


20 Nov 2007 9:02 AM  
You need to configure each instance of the Text/HTML module to use the token replacements. That is in the Settings menu for the page.

Joe Craig
DNN Creative Support
Subscribe to the website
ImageSmith
Nuker
Nuker
Posts:11


20 Nov 2007 10:49 AM  
Posted By bamboo on 20 Nov 2007 7:22 AM
A couple more tokens not listed above that work okay in 4.7.0 newsletters:
[Host: HostTitle]
[Portal: PortalName]
[Date: Current] in addition to [DateTime: Now] (remove spaces after colons)

I can't use Tokens in Text/HTML yet, as after upgrading to DNN 4.7.0, the Text/HTML module is still version 04.05.00 and I can’t see HTML_04.07.00_Install.zip on Sourceforge?

Jeff



Jeff,

I had the same problem. When upgrading to 4.07.00, the html module is not included. I had to download the install package and grab the PA from the install/modules/ folder. I simply installed the module over top of the existing installation.

Earning our stripes... everyday.
imagesmith.com
bamboo
Nuke Newbie
Nuke Newbie
Posts:2

20 Nov 2007 12:01 PM  
Thanks ImageSmith. Much appreciated.

BTW, module installation threw up an error at stage "executing 4.6.0 SqlDataProvider" (invalid object name 'dnn_Modules'). However, Tokens in Text/HTML seem to be working okay? I don't know if the error means future instabilities are likely - too much of a newbie.

pmcalister
Nuke Newbie
Nuke Newbie
Posts:1

16 Dec 2008 11:15 AM  
Hi All,

I have added some new fields to the portal and need to pull the info they collect into the receipt email that Catalook shopping cart sends. Can anyone tell me the proper token? The new fields are Score, Clubs, and Allergies. I have tried using [Profile:Score] and {Profile:Score} formats and they dont work. Any help is greatly appreciated.

Thank you
Paul
jncraig
DNN Creative Staff
Nuke Master III
Nuke Master III
Posts:3750


16 Dec 2008 2:00 PM  
You should be using the square brackets.

Just a guess, but have you enabled token replacement for the module?   It is a setting available in the module settings page.

Joe Craig
DNN Creative Support
Subscribe to the website
You are not authorized to post a reply.
Forums > DotNetNuke® > Modules > Replace Tokens w/ HTML Module



ActiveForums 3.7

Latest Forum Posts

RE: How to Create Module : by jncraig
I'd recommend the book on DotNetNuke module development by Mitchel Sellers, and also adefwebserver.c...
RE: Change Login Page by jncraig
If you want to add modules to the login page, first create on and add the login module. Then add ot...
RE: Background colour by jncraig
Use the Web Developers Toolbar to identify the class of the white area.
RE: [Server Error]This error can be caused by a virtual directory not being configured as an application in IIS. by arm
Posted By mnaoj on 04 Dec 2008 11:46 AMError 1 It is an error to use a section registered as allowDe...
How to Create Module : by hassangas2003
this first my question in aforum,i'm abeginer in DNN,I have web user control already used to old pro...
Background colour by petecarrick
Hi,Sorry if this is a real dumb question, I've been experimenting with the Vortex skin and I have ch...
RE: Horizontal menu vertical borders by petecarrick
That worked perfectly, thanks very much Lee.Pete
Change Login Page by edeakin
Hey guys it’s me again. Great work on session 46 keep up the great work! I want to be able to add m...
RE: Module Wrapper & Tab Aggregator?? by gbrown
Found the Ajax Module Wrapper from Gumbosoft. Bought it and tried it - it works inside of Tab Aggreg...
Module Wrapper & Tab Aggregator?? by gbrown
Has anybody tried to place a Module Wrapper module from ZLDNN inside a Tab Aggregator module from DN...
RE: SWF Tutorial Conversion by raymueller
Thanks and I will continue to research. Each of the applications pick up the introduction (~ 20-25 s...
RE: Please do review by leesykes
There are a couple of things that you could look at:Initial page load time of the sites was slow, t...
RE: Module Development - Settings Page by leesykes
thanks for letting us know the solution and if there's anything else we can help out with please let...
RE: SWF Tutorial Conversion by leesykes
not sure, its not something I have tried, the swf should convert, perhaps its worth googling around ...
RE: not been able to download videos by leesykes
Normal 0 unctuationKerning/> false false false oNotPromoteQF/> ...
RE: Styling the main menu by leesykes
When you add code to your skin.css file, make sure you press CTRL+F5 to reload the page and reload t...
RE: Horizontal menu vertical borders by leesykes
To find the id of the menu item, use the web developers toolbar for Firefox, go to information menu...
RE: Module Development - Settings Page by HMDevelopment
Hello Lee. No thanks -- I have still earned value from this site. I did quite a few 'video' tutor...
RE: Can I modify the Default Events module only for a Portal? by jncraig
If you create a skin for your site, it will apply only to your site.  Also, portal.css applies only ...
RE: How to prevent auser from multiple login. by jncraig
I'm not aware of a way to do that.
DotNetNuke Modules
RSS Feeds