寻找在 DotNetNuke 中过滤模块输出的最佳实践

发布于 2024-09-16 15:12:43 字数 387 浏览 2 评论 0原文

我的一个客户正在迁移到新的 CMS,旧的 CMS 的内容中包含需要替换的占位符,例如(前面的坏示例):{{ID:CurrentShoppingId}},这将替换为当前购物者的 ID。

我可以想到三种方法,但我完全愿意接受新的更好的建议:

  • 创建一个基于 HTML 模块的新模块。缺点:模块无法继承,因此我们必须使用源代码并对其进行更改,或者从头开始创建模块;
  • 查找是否有像OnParseHtmlContent这样的事件并注册一个委托;
  • 使用过滤输出响应流的好旧(坏)方法。

据我所知,DNN 中没有内置方法可以做到这一点(与 WordPress 不同,WordPress 构建了一个又一个的过滤器)。

A client of me is migrating to a new CMS and the old CMS contains 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).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文