Removing support for "template overrides" and mobile-specific templates

In the past, you could override the .hbs template for and Discourse Route or Component by adding an identically named file in the templates/ directory of your theme and plugin. This was very powerful, but also came with significant maintainability issues.

Therefore, we’ve been recommending against template overrides over the last few years, and officially deprecated them in November 2024. Nowadays, the better solution is to use Wrapper Plugin Outlets to render content in place of core content.

This month (March 2025) we will be introducing an admin warning banner for template overrides, and plan to fully remove support before the end of Q2.

Timeline

(estimated dates - subject to change)

  • :white_check_mark: November 2024 - deprecation introduced

  • :white_check_mark: March 2025 - admin warning banner enabled

  • June 2025 - expected removal

Upgrading themes / plugins

Theme and plugin developers should refer to the Plugin Outlet guide to learn more about wrapper plugin outlets. Feel free to open PRs or Dev topics if you’d like to request a new extension point for your use-case.

9 Likes

Is there a way to easily see which theme/plugin is triggering this admin notice? I looked through all of my themes and plugins and don’t see a templates/ directory in the root of their Git repositories for any of them.

2 Likes

It’s in /assets/javascripts/discourse or in /javascripts/discourse, not in the root.

2 Likes

The warning banner should show the name of the theme/plugin. It’ll also be printed in the browser developer console.

If not, perhaps we have a problem with the deprecation - would you be able to share a link to an affected site?

Thank you. It did not show in the warning banner but it did show in the developer console, although not very clearly.

Turned out to be this component.

4 Likes

Thanks @JonahAragon1. The theme identification should be much clearer than that, so I’ll get that fixed up :eyes:

2 Likes

This change will fix the warning banner so it identifies themes more clearly:

4 Likes

Have you find a solution to get back DDG as search suggestion? I’ve disabled the component for now.

No, I just decided to disable the form entirely. I don’t think anyone in my community uses it and I don’t really see the usefulness. I saw the component author proposed an update that requires a core change, so it’ll probably be working again soon.

2 Likes