Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesCustom tokensCustom tokens
Previous
 
Next
New Post
2/3/2011 5:43 AM
 
Hi

I want to find out more about how to create custom replacement tokens for DNN. Ideally I want to be able to use these tokens in core email templates such as user verification emails etc.

I have noticed that many of the core templates use tokens like [Custom:0], [Custom:1] and so on.

Can anyone explain what is going on here and how I can create my own tokens without interferring with core dnn code?

thanks

Rachel
 
New Post
2/3/2011 5:49 AM
 
Tokens allow to access properties of environment objects such as current User, Page, Web Site, current module and Host. To access a property, use [object:property] notation, e.g. [User:DisplayName]. Modules may also provide an extra array of values when calling Token Replace, which can be accessed by using [Custom:1] etc. There is no option atm for admins to provide custom tokens for all TokenReplace use cases.

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
2/3/2011 6:33 AM
 
Sebastian Leupold wrote:
Tokens allow to access properties of environment objects such as current User, Page, Web Site, current module and Host. To access a property, use [object:property] notation, e.g. [User:DisplayName]. Modules may also provide an extra array of values when calling Token Replace, which can be accessed by using [Custom:1] etc. There is no option atm for admins to provide custom tokens for all TokenReplace use cases.

 
thanks Sebastian

I understand how tokens can be used. But my question is how do I create a custom one for my own use. Say for example I want to provide the current
date in a particular format.  And what is going on behind the scenes when I see [Custom:0], [Custom:1] being used in core email templates?

Where in the DNN source code can I find token replacement and how can I extend it?

Rachel

 
New Post
2/3/2011 10:08 AM
 
Rachel,

You can check out Mitch Sellers book for info on creating  custom tokens in a module.  You can also check out "MyTokens" on snowcovered.
(http://www.snowcovered.com/snowcovered2/Default.aspx?tabid=242&PackageID=19921)

But please note that I believe you would have to extend / create your own email module to use your custom tokens. 
The MyTokens module states
"Implicitly, MyTokens will patch the following standard DotNetNuke modules to achieve integration:
  • Text/Html
  • Links
  • Announcements
  • Reports
  • Documents
  • User Defined Table
  • Form and List

Hope this helps,

Robert
 
New Post
2/9/2011 7:47 AM
 
Hi Rachel

I am thinking of using DNN to send my emails. Which Email module do you use and recommend? or do you use the one straight from DNN core installation?
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesCustom tokensCustom tokens


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out