Handlebars template override all in the same html file?

Hello,

I am following the Beginners Guide to Discourse themes guide (this one: Beginner's guide to developing Discourse Themes) but I am getting stuck and have some questions about the Handlebars section.

The guide states if you want to override a template you need to add a script tag with location of the template you want to override to your theme, in my local file I added it to header.html.

Is this the only way?

It is not possible to add a hbr file to my theme in a templates folder that overrides the theme template file?

I doesn’t feel maintainable if I want to make multiple template overrides, it will fill up the header.html really fast and make it unmanageable. I am new to Handlebars so I might be missing something.

So my question is, how does one handle mutliple handlebars template overwrites without making it a big mess in 1 of the html files of a custom theme?

Take note:

2 Likes

Thank you, maybe it is a good idea to remove the Handlebars section from the beginners guide or at least rewrite it to make it very clear this is not the recommended approach to make changes to a custom theme.

Still looking for an answer to my question though.

1 Like

It’s detailed in the linked article in the expandable area.

2 Likes

Thanks Robert, didn’t look at the expandable part… :slight_smile:

1 Like