Beginner's Guide to Creating Discourse Plugins Part 2: Plugin Outlets

plugins

#21

Yes, and presumably you can apply to every available Theme so this can’t be switched off? (to address @sarahann concern about this approach).


(Sarah) #22

I could use display: none but it might now be as secure as we need it to be. And I figured it would be helpful to have a discussion on how to remove / change Discourse UI templates.


How to add a class attribute to a table created using markdown
(Robin Ward) #23

It’s tricky to do properly, unfortunately. For a big customer of ours who needs functionality removed, my approach has been to hide the elements with CSS and remove the controller side actions by using add_to_class to overwrite the methods with an error in plugin.rb.


(Sivert) #25

I have a same problem. I’m working on plugin with topic, and I have to change the html structures but it’s impossible with only CSS. So I was tried to overwrite template but changes never applied.
So do you have find any solution for that?


(Robin Ward) #26

You can override any template in the application if you like (although outlets are always preferred!). How were you doing it? did you confirm the name is exactly the same as the template you are replacing?


(Sivert) #27


I tried to override the “list/topic-list-item.raw.hbs” template, but even though I removed all of the content in template, the topic items still appearing as original, any changing in override template never worked.
Please help me what I was wrong.


(Sam Saffron) #28

See: GitHub - SamSaffron/discourse-simple-theme: Sam's simple discourse theme for an example of how it is done.


Overriding built-in templates (and stylesheets)