felix7 Posted January 4, 2018 Share Posted January 4, 2018 (edited) Hi, I'm trying to add my own module CSS to header, but I can't. I register the module in 'displayHeader' hook and then, in 'hookDisplayHeader' method I add it: $this->context->controller->addCSS($this->_path . 'aaa.css'); Just that code in the method. Module is in 'modules' folder on root dir, and CSS in css folder inside the module. I have seen other modules, and I tried copy CSS in "root/themes/nameTheme/css/modules/mymodule', but it doesn't work. Any idea? I have to say I register the module in another hook (displayTopColumn) and it works. Thanks in advance. Edited January 28, 2018 by felix7 (see edit history) Link to comment Share on other sites More sharing options...
roja45 Posted January 4, 2018 Share Posted January 4, 2018 $this->context->controller->addCSS($this->_path . 'css/aaa.css', 'all'); Link to comment Share on other sites More sharing options...
roja45 Posted January 4, 2018 Share Posted January 4, 2018 though you should really put it in: $this->context->controller->addCSS($this->_path . 'views/css/aaa.css', 'all'); 1 Link to comment Share on other sites More sharing options...
felix7 Posted January 7, 2018 Author Share Posted January 7, 2018 (edited) En 4/1/2018 a las 7:29 PM, roja45 dijo: $this->context->controller->addCSS($this->_path . 'css/aaa.css', 'all'); It doesn't work. I saw 'hookDisplayHeader' from 'homeslider' module and it is the same, even without 'all', but I don't know why mine is not working. '$this->_path' is correct (root/modules/aaa). Edited January 7, 2018 by felix7 (see edit history) Link to comment Share on other sites More sharing options...
Rhobur Posted January 14, 2018 Share Posted January 14, 2018 in hookHeader() function add: $this->context->controller->addCSS($this->_path.'/views/css/your_css_file.css'); 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now