How to use api.onPageChange with api.createWidget?

It’s a little more complicated than that to translate to a locally installed theme component, but one way to add some flexibility to a remote theme would be using theme settings (⚙ Add settings to your Discourse theme).

That involves adding a settings.yml file and updating a few values in the component and/or template. Then you get settings on your theme component admin page like this:

It’s also fine to stick with the widget implementation above and update via the admin panel, but we tend to recommend using git when possible; it’s easier to share if you need to troubleshoot, and it makes it easy to track your changes.

1 Like