Example Plugin: Custom Activity Summary Template

Hey everyone,

I have created an example plugin to override default Activity Summary (digest) template:

https://github.com/muhlisbc/discourse-custom-activity-summary-template

Screenshot:

https://github.com/muhlisbc/discourse-custom-activity-summary-template/raw/master/custom-digest1.jpg

https://github.com/muhlisbc/discourse-custom-activity-summary-template/raw/master/custom-digest2.jpg

The main purpose of this plugin is to show how to override default .erb templates on Discourse.
I hope this helpful for someone.

26 个赞

@mbcahyono

感谢您提供示例插件。我正在尝试做类似的事情,我需要用我的插件中的文件替换/覆盖 /app/views/embed/comments.html.erb 文件。

这是我的仓库:

https://github.com/OptDev/optuma-discourse-custom-embed

我不确定为什么这不起作用,我以为 EmbedController 是正确的类,但显然我错了。您有什么建议吗?

1 个赞

@mbcahyono 我终于搞定了,谢谢你的帮助。

1 个赞

上面的存储库不再可用。
如果能从中学习就好了。

1 个赞

@thoka 这是我的存储库,它最终进入了我们在 GitHub 上的私有空间。

这是一个非常基础的更改,但其要点可以在这里看到。

3 个赞