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 ExtensionsModulesModulesHow to use DNN tokens in custom modules ?How to use DNN tokens in custom modules ?
Previous
 
Next
New Post
12/15/2014 6:46 PM
 
If you are building your own module then you are maybe going about your thinking wrongly.
What exactly are you trying to achieve?

If you are just trying to inject code into the module's ascx layout then you would not use tokens.
Instead you could use native asp.net markup to simply inject the Moduleid property of the module into the page.

<div id="mymodule-<%=ModuleId%>">

Westa
 
New Post
12/16/2014 6:34 AM
 
Sebastian Leupold wrote:
this blog post describes the TokenReplace engine: http://www.dnnsoftware.com/community-...

Cheers Sebastian for the blog link. That would come in handy at some point.

 

Mike Ryckman wrote:
It's true that, to do what you're going for here, referencing the module ID is probably easiest. With that said, if you wanted to use tokens, you'd just have to do so in a manner that works with how web forms works (until DNN moves to vnext).

Hey Mike when is vNext coming on stream do you know?

 

Wes Tatters wrote:
<div id="mymodule-<%=ModuleId%>"></div>
Westa

Cheers Wes that is exactly what I did.

 

Originally I wanted to utilise DNN tokens in order to provide numerical reference to my modules div container to account for multiple instance of my module on the same page (just in case). But as Michael said earlier this would require addition of token conversion code. Simple requirement of getting access to one token, ModuleID, and lack of time required to actually implement token replacement code I decided that its just not worth it. Instead I implemented very simple property that gets ModuleId value from ModuleContext. And thats that. Everyone is happy.

On a final note I would like to thank everyone for their input which was very helpful.

 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesHow to use DNN tokens in custom modules ?How to use DNN tokens in custom modules ?


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