TinyStore Posted August 18, 2018 Share Posted August 18, 2018 Is there anything else you need to do besides using: $this->context->controller->addCSS($this->_path . 'views/css/XXX.css'); I have this in my hook function and I have my hook working but cannot get the css or js. Link to comment Share on other sites More sharing options...
ican Posted August 18, 2018 Share Posted August 18, 2018 2 hours ago, TinyStore said: Is there anything else you need to do besides using: $this->context->controller->addCSS($this->_path . 'views/css/XXX.css'); I have this in my hook function and I have my hook working but cannot get the css or js. Try this : public function hookHeader() { $this->context->controller->addCSS($this->_path . 'views/css/XXX.css', 'all'); } Link to comment Share on other sites More sharing options...
TinyStore Posted August 18, 2018 Author Share Posted August 18, 2018 That didn't work either. I put die; in the header and nothing happens so I don't think it's being called. I get it to work by putting it under parent::__construct(); I cannot understand what I'm doing wrong. Link to comment Share on other sites More sharing options...
Knowband Plugins Posted August 18, 2018 Share Posted August 18, 2018 If control is not coming into header hook function then most probably header hook is not registered by the module. You need to register the header hook function first (At the time of module installation). 1 Link to comment Share on other sites More sharing options...
ican Posted August 18, 2018 Share Posted August 18, 2018 1 hour ago, TinyStore said: That didn't work either. I put die; in the header and nothing happens so I don't think it's being called. I get it to work by putting it under parent::__construct(); I cannot understand what I'm doing wrong. Can you mplease share code in php file so that i can found what is missing. Link to comment Share on other sites More sharing options...
TinyStore Posted August 18, 2018 Author Share Posted August 18, 2018 The header hook function was not registered as Knowband Plugins indicated. Thanks for the help. 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