Theme templates can be overridden by placing twig-templates of the same name in plugins/[theme]/templates.
Plugin-templates can be overridden by placing twig-templates of the same name in plugins/[theme]/templates/plugin/[plugin]/
It would be great if this could be included in upcoming piwik versions as it improves theming a lot
Could you explain the use case for this change? What are you trying to achieve?
Ideally it would be nice if you could use only template hooks to theme and "add" content within templates. See for example this commit where I added few generic hooks for themes to "add" content within the pages: c3b6c38e84ecba
We are providing piwik as SaaS solution. To incorporate our corporate design we needed to modify some parts of the dashboard.twig and login.twig templates.
Working with PostEvents in twig would probably be possible in our case, but not as comfortable, as you start coding html-code in your PHP files (or you had to bootstrap twig to load your own template structure, which again is some bit of code).
As twig provides great possibilities for overwriting templates, I think it should also be available in the "themes" feature of piwik (just "adding" some HTML is sometimes not enough).
I've created a ticket for this feature at: http://dev.piwik.org/trac/ticket/5122
it's useful and it makes sense. Thanks for the suggestion and pull request!