Jump to content

SOLVED - Add module CSS to header


Recommended Posts

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 by felix7 (see edit history)

Share this post


Link to post
Share on other sites
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 by felix7 (see edit history)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More