Update stylesheet of plugin


#1

Hello !

I am working on a new plugin for piwik 2.0 and was wondering about the stylesheets.
In the hook calls, I use the

AssetManager.getStylesheetFiles

to call a function in which I simply add to the stylesheet array a new path of my css.
The first time I install the plugin on Piwik, the css is taken into account. The problem is when developing on this css afterwards, the changes are not taken into account: it is not a cache problem, it looks like Piwik keeps the css in memory… or smth like that.

Is there a trick to overcome this bloquing ? The only way I found to update the visual is to deactivate + desinstall + install the plugin, which is a nightmare :slight_smile:

Thanks for your precious help.


#2

when it comes to css, i learned by trial and error that piwik does not use the normal css files, but rather the mirror version stored in the temp directory… so, all changes are only becoming effective after deleting tmp/assets/asset_manager_global_css.css and hence forcing piwik to rebuild this global css file… i dont know how often piwik rebuilds this css file itself, but it surely does not do so when a file is changed, unlike php changes which are immediately visible


#3

Hey Glisse,

Thank you very much for your time and for the hint ! Yes, that was it ! It’s still a little cumbersome to reload (it looks like it needs at least 30sec to regenerate both the js and css files), but at least I can see my updates :slight_smile:

Thanks again!


#4

Glad I could help… from what i recall after deleting the tmp file, reloading the site immediately rebuilt the css file, so it took 1-2 seconds, not 30… but dunno in your case… anyway, best of luck!


(Matthieu Aubry) #5

That’s a good point. to not have to reload the CSS please use the “Disable merged assets” see: Troubleshooting - Analytics Platform - Matomo


#6

Thank you Matt, that is really what I needed ! (tu)