Looking for a best practice to filter module output in DotNetNuke
A client of me is migrating to a new CMS and the old CMS conta开发者_运维百科ins placeholders in the content that need to be replaced, something like (bad example ahead): {{ID:CurrentShoppingId}}
, which would be replaced with the ID of the current shopper.
I can think of three ways, but I'm totally open to new and better suggestions:
- Create a new module based on HTML Module. Drawbacks: a module cannot be inherited from, so we have to use the source and alter it, or create a module from scratch;
- Find out whether there's an event like
OnParseHtmlContent
and register a delegate; - Use the good old (bad) approach of filtering the output response stream.
As far as I know, there's no built-in method in DNN to do this (as opposed to — say — WordPress, where filter upon filter is built).
The HTML modules supports limited token replacement. For something more robust there are third party modules available as well. http://www.avatar-soft.ro/dotnetnuke/modules/token-replacement/my-tokens.aspx
精彩评论