mbcahyono
(Muhlis Cahyono)
29.Август.2017 22:35:53
1
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:
The main purpose of this plugin is to show how to override default .erb templates on Discourse.
I hope this helpful for someone.
26 лайков
Mark_Wass
(Mark Wass)
21.Февраль.2023 05:17:55
2
@mbcahyono
Спасибо за предоставленный пример плагина. Я пытаюсь сделать что-то подобное: мне нужно заменить/переопределить файл /app/views/embed/comments.html.erb на файл из моего плагина.
Вот мой репозиторий:
https://github.com/OptDev/optuma-discourse-custom-embed
Не понимаю, почему это не работает. Думал, что правильным классом будет EmbedController, но, очевидно, ошибся. Есть какие-то предложения?
1 лайк
Mark_Wass
(Mark Wass)
21.Февраль.2023 06:44:32
3
@mbcahyono Наконец-то у меня получилось, спасибо за помощь.
1 лайк
thoka
(Thomas Kalka)
07.Март.2023 16:09:01
4
Вышеуказанный репозиторий больше недоступен.
Пришлось бы с радостью поучиться на его примере.
1 лайк
Mark_Wass
(Mark Wass)
07.Март.2023 21:14:28
5
@thoka Это был мой репозиторий, он оказался в нашем приватном пространстве на GitHub.
Это было очень простое изменение, но суть его можно увидеть здесь.
@Canapin Yes! Got it all working. Here is what the plugin.rb ended up looking like. Turned out I just had a path issue where I was putting the custom version of the file.
I ended up putting it in a folder /custom_views/embed/comments.html.erb
# frozen_string_literal: true
# name: optuma_discourse_custom_embed
# about: A simple plugin to used to customise the template in the forum embeds
# version: 1.0.0
# authors: Optuma Pty Ltd
# url: https://github.com/OptDev/optuma-discourse-custom-embed
#…
3 лайка