mbcahyono
(Muhlis Cahyono)
August 29, 2017, 10:35pm
1
26 Likes
Mark_Wass
(Mark Wass)
February 21, 2023, 5:17am
2
@mbcahyono
Thanks for supplying your example plugin. I’m trying to do something similar, I need to replace/override the /app/views/embed/comments.html.erb file with the one in my plugin.
This is my repo:
I’m not sure why this is not working, I thought EmbedController would be the correct class to use but I’m obviously wrong. Do you have any suggestions?
1 Like
Mark_Wass
(Mark Wass)
February 21, 2023, 6:44am
3
@mbcahyono I finally got it working thank you for your help.
1 Like
thoka
(Thomas Kalka)
March 7, 2023, 4:09pm
4
Above repo is no longer available.
Would have been glad to be able to learn from it.
1 Like
Mark_Wass
(Mark Wass)
March 7, 2023, 9:14pm
5
@thoka That was my repo, it ended up in our private space on GitHub.
It was a very basic change but the gist of it can be seen here.
@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 Likes