Add support for theme settings

There is actually an issue with the precompiler that it doesn’t recognize this as the template’s context object. However, I just realized that we don’t really need the precompiler to recognize this because the helper function here is bound to the template context object, so this inside the helper function refers to the template context, which is exactly what we need here. Will put together PR to demonstrate what I mean.

EDIT:

PR sent: FEATURE: theme settings in RAW hbs templates by OsamaSayegh · Pull Request #5758 · discourse/discourse · GitHub cc @vinothkannans

Tested this change with 4 different scenarios:

  • overriding an Ember template
  • overriding a raw template
  • using a plugin outlet in an Ember template
  • using a plugin outlet in a raw template

And it worked in all of them :tada:

9 Likes