xezus Posted March 17, 2013 Posted March 17, 2013 Hi, I would like to add a new css into my project, but I don't know how to add it into the $css_files array. And I don't want to add it just into the header. I would like to keep simple clarity. The position of my new css is in the theme/css. Thanks for any replies. Share this post Link to post Share on other sites More sharing options...
NemoPS Posted March 18, 2013 Posted March 18, 2013 (edited) You can simply use $this->context->controller->addCSS(path....); You've got to do it from a module, of course (or page) Edited March 18, 2013 by Nemo1 (see edit history) 1 Share this post Link to post Share on other sites More sharing options...
Denver Prophit Jr. Posted May 3, 2015 Posted May 3, 2015 You can simply use $this->context->controller->addCSS(path....); You've got to do it from a module, of course (or page) Is that still applicable? Say I have removed google fonts from default-bootstrap and created a new file called opensans.css to define font-face with .woff files. Would I have to do this in header.tpl? If so, I need to do {php}...{/php} in the smarty file? Share this post Link to post Share on other sites More sharing options...
NemoPS Posted May 4, 2015 Posted May 4, 2015 You can either go for the modular way (with php, above) or use a normal <link rel... in header.tpl Share this post Link to post Share on other sites More sharing options...
defuzed Posted May 4, 2015 Posted May 4, 2015 Note that the "normal" `<link rel` way Nemo mentioned above will not compress and combine the css file when ccc is enabled. If you do not want to go through the trouble of creating an extra module just to include a css file you could also override the `setMedia()` function in one of the front controllers. In your case Denver Prophit i would override the FrontController.php and and put `$this->addCSS(_THEME_CSS_DIR_.'opensans.css');` above the `parent::setMedia();` call 1 Share this post Link to post 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