Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added possibility to modify twig templates in own theme. #263

Merged
merged 1 commit into from May 9, 2014
Merged

Added possibility to modify twig templates in own theme. #263

merged 1 commit into from May 9, 2014

Conversation

datamints
Copy link

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

Theme templates can be overridden by placing them in plugins/[theme]/templates.
Plugin-templates can be overridden by placing themb in plugins/[theme]/templates/plugin/[plugin]/
@mattab
Copy link
Member

mattab commented Apr 25, 2014

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: c3b6c38

@datamints
Copy link
Author

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).

@mattab
Copy link
Member

mattab commented May 9, 2014

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!

@mattab mattab merged commit 6899ba9 into matomo-org:master May 9, 2014
@mattab
Copy link
Member

mattab commented Jun 7, 2014

@datamints a Piwik user was trying out your feature, and found an infinite loop. Maybe you could give him a hand? the ticket in issue tracker is: http://dev.piwik.org/trac/ticket/5305

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants