Hi all,
In the latest versions of DNN there is a interface to create custom token repleacemet provider. I want to creat my custom token replacement provider. Are the any examples of this or is there any documentation on how to implement this?
Hi Joe, I've been looking into that too, recently. It looks like you can just create your own TokenProvider class, make it inherit DotNetNuke.Services.Tokens.TokenProvider and register it in web dot config as the default one.
public class JoesTokenProvider : TokenProvider { /// public override bool ContainsTokens(string content, TokenContext context) { return false; // already determined by BaseCustomTokenReplace } /// public override string Tokenize(string content, TokenContext context) { var tokenizer = new TokenReplace { TokenContext = context }; return tokenizer.ReplaceEnvironmentTokens(content); } }
Then you can implement it however you want to implement it.
But I haven't tried it yet myself either...
Greetz, Stefan
Sounds cool!
From what version on is 'Latest versions'? And where does it reside?
These Forums are dedicated to the discussion of DNN Platform.
For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:
Awesome! Simply post in the forums using the link below and we'll get you started.