Allow more HTML markup customization for developers


(Alexandre Angelim) #1

I’ve noticed that Discourse has some flexibility to customize stylesheets and headers, but I’d like to know how developer oriented admins are doing when they feel the need to hook up HTML snippets in a certain point/container.

I’m a SpreeCommerce (http://guides.spreecommerce.com/developer/view.html) user and they came with a simple enough solution to use Deface (https://github.com/spree/deface) in order to allow template customization. The idea is to insert hooks in html elements making it easier for the developer to reach them and attach whatever he wants before, after, inside or around it.

I know the bulk of templates is being done using handlebars for ember, but I don’t think it would invalidate the method with minor tweaks. If we find a way to override those views before handlebars is compiled, we’d be ok.

The overrides are done in separate files in a non obtrusive manner, so core updates wouldn’t cause conflict(at least not a lot).

I understand this project doesn’t preach forking, as SpreeCommerce does, but I think it would be a good first step to allow discourse forums to differentiate themselves. It would also create incentives for third-party companies to work in project customizations.


(Vikhyat Korrapati) #2

It is possible to override entire handlebars templates from plugins:

https://meta.discourse.org/t/how-to-override-an-existing-handlebars-template-from-plugin/10201/5?u=radq&source_topic_id=13955

(Alexandre Angelim) #3

Thanks @radq. I didn’t see that in the documentation. That solves the problem.


(Régis Hanol) #4