Override core templates

Hey :slight_smile:

I'ml trying to implement a plugin that would add functionality to existing components of OctoPrint's UI, namely the control tab. For this, i would like to be able to override the template file (in that case, it's src/octoprint/templates/tabs/control.jinja2) in order to add new DOM to it.

Is this something that is possible ? I tried using TemplatePlugin but it seem to only let me create new tabs, not edit the existing ones.

Thanks a lot !

Yes, it's possible using replaces in the get_template_configs function call. However, if you're just wanting to add buttons there are easier ways than replacing the entire template.

https://docs.octoprint.org/en/master/plugins/mixins.html#octoprint.plugin.TemplatePlugin.get_template_configs

I'll take a look at get_template_configs, seems like it's what i'm looking for. I also found your answer from another question (Add buttons to control tab) which seem to be a good read aswell.

Will investigate ! Many thanks.