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

Forum

Replace Tokens w/ HTML Module
Last Post 2011-10-18 09:02 PM by IntelligentNetware. 24 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Page 1 of 212 > >>
Author Messages
Thomas SmithUser is Offline
Nuker
Nuker
Posts:12
Avatar

--
2007-11-13 06: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
Joseph CraigUser is Offline
DNN Creative Support
Nuke Master VI
Nuke Master VI
Posts:9315
Avatar

--
2007-11-13 07: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 DNNCreative
I recommend PowerDNN for DotNetNuke Hosting.
Joseph CraigUser is Offline
DNN Creative Support
Nuke Master VI
Nuke Master VI
Posts:9315
Avatar

--
2007-11-13 07: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 DNNCreative
I recommend PowerDNN for DotNetNuke Hosting.
Thomas SmithUser is Offline
Nuker
Nuker
Posts:12
Avatar

--
2007-11-13 08:17 PM  
Thanks for your feedback.

There is also support for TOKENS in the Newsletter/BulkEmail Module...
http://www.dotnetnuke.com/Community...fault.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
Lee SykesUser is Offline
DNN Creative Staff
Nuke Master VI
Nuke Master VI
Posts:4945
Avatar

--
2007-11-13 09: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/DNNCreative

Lee Sykes's Facebook Profile
JeffUser is Offline
Nuke Newbie
Nuke Newbie
Posts:2

--
2007-11-20 12:22 PM  
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

Joseph CraigUser is Offline
DNN Creative Support
Nuke Master VI
Nuke Master VI
Posts:9315
Avatar

--
2007-11-20 02:02 PM  
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 DNNCreative
I recommend PowerDNN for DotNetNuke Hosting.
Thomas SmithUser is Offline
Nuker
Nuker
Posts:12
Avatar

--
2007-11-20 03:49 PM  
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
JeffUser is Offline
Nuke Newbie
Nuke Newbie
Posts:2

--
2007-11-20 05: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.

Paul McAlisterUser is Offline
Nuke Newbie
Nuke Newbie
Posts:1

--
2008-12-16 04:15 PM  
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
Joseph CraigUser is Offline
DNN Creative Support
Nuke Master VI
Nuke Master VI
Posts:9315
Avatar

--
2008-12-16 07: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 DNNCreative
I recommend PowerDNN for DotNetNuke Hosting.
CodepointUser is Offline
Nuke Newbie
Nuke Newbie
Posts:6

--
2009-11-19 03:55 PM  
There is any token or way to show in the HTML module the last content modified date?
Joseph CraigUser is Offline
DNN Creative Support
Nuke Master VI
Nuke Master VI
Posts:9315
Avatar

--
2009-11-22 03:53 AM  
I have seen a module (check Snowcovered) that will display the last modified date for all of the content on a page.  I don't think that there is a token.

Joe Craig, DNN Creative Support

Subscribe to DNNCreative
I recommend PowerDNN for DotNetNuke Hosting.
Bogdan LitescuUser is Offline
Nuke Newbie
Nuke Newbie
Posts:2

--
2010-03-31 09:31 PM  
Hello,

Some time ago I needed a lot more from tokens and ended up writing my own module which ended up as a commercial module, MyTokens. Today it supports creating tokens from Database, local files, files on FTP Servers, HTTP Requests, POP3 and IMAP Servers.

With MyTokens, you can accomplish what you need by creating a database token that retrieves the relevant field from Html table in the database. You would have to pass in the module id, so the SQL query for the token would look like Select ModifiedDate from Html Where ModuleID=[Module:ModuleID]. Then, you would put [MyNamespace:MyTokenName] in the content of the html module and will get replaced with date last modified.

You can read more about MyTokens and download a trial version at
http://www.avatar-soft.ro/Products/...fault.aspx

Please let me know if you need more info.

Regards,
Bogdan
Kontorshotell StockholmUser is Offline
Nuke Newbie
Nuke Newbie
Posts:1

--
2010-10-24 01:01 AM  
If I want to add businesslogic to the Token Replace enginge inside dotnetnuke and mostly in hte Html/text module. Do I have to recompile the Html/Text moduleto make a new version of it OR is there a way to override that particular token Replace method inside and let a new Token REplace method execute without recompiling the Html/Text module?

If that is possible andI can put the new business logic for Html/text module token Replace in another dll then I don'trisk having thisparticular business logic disapear as soon as Dotnetnuke core is updated .....

Can I putmy new Token replace logic in a separate dll andhavethisoneexecuted everytime html/Text module is used WIHTOUT recompiling the Html/Text module?
Kontorshotell
Joseph CraigUser is Offline
DNN Creative Support
Nuke Master VI
Nuke Master VI
Posts:9315
Avatar

--
2010-10-24 10:07 PM  
You might want to take a look at the MyTokens module referenced in this thread.  I have not used this particular module, but I have used a couple of other modules from Avatar Software.  Those modules do what I need, and Avatar's support is good.

Joe Craig, DNN Creative Support

Subscribe to DNNCreative
I recommend PowerDNN for DotNetNuke Hosting.
drew curryUser is Offline
Nuke Newbie
Nuke Newbie
Posts:1

--
2010-11-17 12:52 PM  
Question: when using tokens, is there any way to have it intelligently replace itself depending on if a user is logged in or not? I don't like having an extra space in text for [User:FirstName] to render properly and then have this space show up for the not-logged-in state. Surely this was thought of during the development of the token rendering? Thanks for any tips, drew..
Joseph CraigUser is Offline
DNN Creative Support
Nuke Master VI
Nuke Master VI
Posts:9315
Avatar

--
2010-11-18 12:33 PM  
No.  Unfortunately not.  You might want to look at Joe Brinkman's recent blog entry on "Extending the Blog Module" or a similar  le.  Look in the blog section at dotnetnuke.com.

You could have two modules, one for logged in visitors and one for those not logged in.

It may be possible to include conditional coding in the HTML version of the module contents.  Something like this:

 < %  If Request.IsAuthenticated Then% >
             
         put your code here ...

 < % End If% >

(removed the spaces around the brackets)

Joe Craig, DNN Creative Support

Subscribe to DNNCreative
I recommend PowerDNN for DotNetNuke Hosting.
Gustavo RodriguezUser is Offline
Nuke Newbie
Nuke Newbie
Posts:3

--
2011-02-28 01:40 PM  
hi,

I was wondering if there would be some global tokens that could be retrieved from the user info (once they enter it) such as name, last name, telephone number, email, address, etc.. I need to use this info on a module that allows me to send or receive emails according to a pre stablished html template (where the tokens would go).

To Make things clearer: User James Bond register in my page, this information goes to our data base (name, lastname, phone, address, email), then, through a module I want to be able to retrieve this information using tokens inserted on an html template, for emailing purposes and such.. is this possible at all?

Thanks!!
Joseph CraigUser is Offline
DNN Creative Support
Nuke Master VI
Nuke Master VI
Posts:9315
Avatar

--
2011-02-28 02:04 PM  
If you are doing this in the Text/HTML module, you need to enable token replacement, and then there are lots of tokens defined that you can use.

If you are doing this in a custom module, just use the userInfo object.

If neither of these is what you need, ask again.

Joe Craig, DNN Creative Support

Subscribe to DNNCreative
I recommend PowerDNN for DotNetNuke Hosting.
You are not authorized to post a reply.
Page 1 of 212 > >>


Active Forums 4.3

Latest Forum Posts

PCI Compliance with PayPal integration by Aggiedan97
Recently it was brought to my attention that sites (companies of sites) that handle the selling of g
RE: Active Forums vs. DNN 6.2 CE by Joseph Craig
I haven't really previewed it, but my understanding is that pretty much everything except the "Mail
RE: horizontal main and submenu items by Joseph Craig
If you could show a page as an example, that would help. Basically, you can put multiple menus on
Active Forums vs. DNN 6.2 CE by Aggiedan97
Active Forums will no longer be offered with the debut of DNN 6.2 which is promising to integrate Ac
Google Analytics Module by Aggiedan97
I'm in need of providing a GA module that displays GA charts, graphs, and reports internal to DNN si
RE: horizontal main and submenu items by Dan Glanton
I'm not sure. One of the tutorials show using 2 horizontal menus with one being the submenu. This do
RE: Different search icon for each portal by Joseph Craig
Are you using the same skin in each portal? If so, and assuming that you are using the SiteIconURL
Different search icon for each portal by Bill Swanson
How do I use a different search icon for each portal in dnn 6.1.4?
RE: horizontal main and submenu items by Joseph Craig
Do your requirements fit with any of the available templates?
RE: horizontal main and submenu items by Dan Glanton
I went ahead and upgraded to the DDR to make sure I have the best updated menu possible. What I woul
RE: DNN 6.2 by Joseph Craig
The release notes that came with the beta version of the software should indicate if the version can
RE: horizontal main and submenu items by Joseph Craig
Part of the answer will depend on the menu that you are using in your skin. I strongly recommend th
DNN 6.2 by Sameer
Hi All i am using dnn 6.2 beta version for my demo site i need to custmize the 4 modules in that
RE: Deploying dnn by Sameer
Thanks a lot so kind of you
RE: Unable to Create Skin Package by schilders
Joe, When I click the Edit icon next to the skin package on the Host Extensions page, I receive t
horizontal main and submenu items by Dan Glanton
I found a very good tutorial on horizontal main and subitems in DNN Creative, but what about if you
RE: Skin creation - Menu questoni by Joseph Craig
This has to do with the structure of the elements that make up the skin and the CSS. Most likely, y
Skin creation - Menu questoni by CDMeyer
I have a skin and when I add more menu items to the nav bar than can fit in one row of nav, the seco
RE: FCK Editor in DNN 6 by Pingle2009
Just to follow on from Joe's reply, the 'official' line seems to be that not only that the old FCK E
RE: Slice a Site by Dan Glanton
Thanks, I'll look into that when I get a chance.
You are not logged in.
You must log in to access all 
650+ videos, tutorials, podcasts, and more.
RSS Feeds