Can you override 'any' file in Discourse via a plugin?

I thought this was the case but on trying it recently it didn’t work (I also searched for an answer here and Google but didn’t find anything concrete, so hopefully this might help someone in future).

It’s been a while since I read about plugins but from memory does it go something like this?

  • rails g plugin NAME
  • locate the file you want to change
  • change it first to test it does what you need, if it does…
  • copy it into the same directory in your plugin
  • make your changes and the changes should take effect
1 Like

No, you override class/method rather a file, so filename may dosn’t matter. If you don’t know about the plugin structure you can read some offical plugin source code.

8 Likes