cd /var/discourse
./launcher enter app
x86_64 arch detected.
root@discourse-app:/var/www/discourse# cd app/views/embed/
root@discourse-app:/var/www/discourse/app/views/embed# nano comments.html.erb
Nano was not installed so I installed it and edited comments.html.erb replacing the lines mentioned in the referred post.
I then exited the launcher and ran
./launcher rebuild app
After the rebuild it did not make any difference, I still see usernames instead of Full Names in the embeds.
But I don’t seem to be seeing the changes I’m expecting in embeds. I’ve added a couple of custom css class names and I’ve changed <%= post.user.username %> to <%= post.user.name %>. Would appreciate some more nudging in the right direction to get this working. I can’t imagine it’s too complicated to override a plugin template file from another plugin.
What I have been able to do is enter the app and manually copy my plugins version of the template over to /var/www/discourse/app/views/embed/ then I restart the app and I see the results I’m looking for.
I just need to have the auto-magically happen when the plugin is loaded, and that’s where I’m stuck.
@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
# required_version: 2.7.0
after_initialize do
::EmbedController.prepend_view_path File.expand_path("../custom_views", __FILE__)
end