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

Let Themes overwrite templates to allow full customisation within Themes #5122

Closed
mattab opened this issue May 9, 2014 · 3 comments
Closed
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Milestone

Comments

@mattab
Copy link
Member

mattab commented May 9, 2014

Piwik comes with a powerful theming framework that lets Theme designers fully customise the look and feel of Piwik.

There are actually several ways to customise a design with a theme:

  • you may overwrite CSS via the Theme CSS files
  • you may inject JavaScript to run custom code on the client side
  • you may hook in the template hooks such as: Template.beforeTopBar, Template.footer, Template.beforeContent

The goal of this ticket is to add a new mechanism to give Theme designers even more control and power over the way Piwik looks and feels:

  • As a theme designer I want to overwrite the twig templates in my theme, so I can customise the HTML and structure of any given functionality.

This change was proposed in the pull request: #263

@mattab
Copy link
Member Author

mattab commented May 9, 2014

Fixed in 8e45483

@tassoman
Copy link
Contributor

tassoman commented Jun 4, 2014

Well I've tested this feature a bit.

I edited ExampleTheme plugin shipped with git master branch. I've added a file called plugins/ExampleTheme/templates/dashboard.twig, I've pasted content from original file Morpheus/templates/dashboard.twig editing with custom HTML.

Then reloading page, twig engine reloaded template cache and shown my modification in the dashboard without any tmp/* deletion.

I'm in troubles overriding plugins templates. I've created plugins/ExampleTheme/plugins/VisitorGenerator/generate.twig file with same modifications, then reloading index.php (dashboard) the browser (my version is latest Firefox) goes timed out. Looks like a kind of loop not mentioned into Apache's error.log

@mattab
Copy link
Member Author

mattab commented Jun 5, 2014

@tassoman Thanks for report. do you mind creating a new ticket with the use case that bugs? Since this ticket is now closed (feel free to link to this ticket from new one)

@mattab mattab added this to the 2.3.0 - Piwik 2.3.0 milestone Jul 8, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Projects
None yet
Development

No branches or pull requests

2 participants