KenFranklin Posted February 13, 2015 Share Posted February 13, 2015 How to add styles to Back office frome custom theme. I can't from my custom module, because it dont work when module not open. May be add styles during installation to Back office? Link to comment Share on other sites More sharing options...
deuterit Posted February 13, 2015 Share Posted February 13, 2015 Just register admin header/footer hook in your custom module and add there link to your stylesheets. Alternatively you can override AdminControllerCore::setMedia() and add there $this->addCSS('linkto/stylesheets.css'). Link to comment Share on other sites More sharing options...
KenFranklin Posted February 13, 2015 Author Share Posted February 13, 2015 Thank you. AdminControllerCore::setMedia() - how can I override? Link to comment Share on other sites More sharing options...
deuterit Posted February 16, 2015 Share Posted February 16, 2015 (edited) Just create a file in PRESTA_PATH/override/classes/controller/AdminController.php with following contents: <?php class AdminController extends AdminControllerCore { public function setMedia() { parent::setMedia(); $this->addCSS(__PS_BASE_URI__.'path_to_your_css_file.css', 'all', 10); } } After creating this file you may need to clear (delete file) Prestashop class cache. It's in path: PRESTA_PATH/cache/class_index.php. // Edit: I don't know why but forum strips all spaces/indents from code I'm pasting. Here you have better formated code: http://pastebin.com/nWTzcjMH Edited February 16, 2015 by deuterit (see edit history) Link to comment Share on other sites More sharing options...
KenFranklin Posted February 16, 2015 Author Share Posted February 16, 2015 Thank you very much! Link to comment Share on other sites More sharing options...
Recommended Posts