Akawan Posted December 26, 2011 Share Posted December 26, 2011 Bonsoir, J'ai un soucis pour overrider le css des modules où les fichiers css sont dans /mon_module /css, il ne trouve pas le fichier à prendre en compte. Pour blocktopmenu, j'ai essayé de le mettre dans /mon_theme/css/modules/blocktopmenu/css/superfish-modified.css et dans /mon_theme/css/modules/blocktopmenu/superfish-modified.css Rien n'y fait, fichier non pris en compte. Quelle est la bonne méthode? Merci et bonne fêtes Link to comment Share on other sites More sharing options...
Stéphane Chonez Posted December 26, 2011 Share Posted December 26, 2011 bonjour, il faut plutôt mettre dans : /mon_theme/module/blocktopmenu/css/superfish-modified.css bonnes fêtes Link to comment Share on other sites More sharing options...
Akawan Posted December 27, 2011 Author Share Posted December 27, 2011 bonjour, il faut plutôt mettre dans : /mon_theme/module/blocktopmenu/css/superfish-modified.css bonnes fêtes J'ai essayé, ça ne fonctionne toujours pas. J'ai biensur reloadé les css, effacé le cache et forcé smarty à recompiler :/ bonnes fêtes à toi aussi Link to comment Share on other sites More sharing options...
Stéphane Chonez Posted December 27, 2011 Share Posted December 27, 2011 j'ai fais une erreur il faut mettre modules avec un "s" dans ton thème!!!! /mon_theme/modules/blocktopmenu/css/superfish-modified.css Link to comment Share on other sites More sharing options...
prestaZ Posted March 17, 2012 Share Posted March 17, 2012 Hallo Akawan, Could you figure it out? It's still not working even if I do as Stephane suggested... Link to comment Share on other sites More sharing options...
Atch Posted March 17, 2012 Share Posted March 17, 2012 Hi You have à other css to overide!!! cache/menu.css V++ Atch Link to comment Share on other sites More sharing options...
prestaZ Posted March 18, 2012 Share Posted March 18, 2012 Hello Atch, cache/menu.css - where is that?? I could not find it anywhere.. Also, how to override it? I read in some other place that it is not possible to override CSS files, but only the .tpl files and edit them in such a way that they point to other CSS files than the original. But I also cannot figure it out how to do that, too. I added following code to my blocktopmenu.tpl (under themes/mytheme/blocktopmenu): <link href=”{$css_dir}blocktopmenu/superfish-modified.css” rel=”stylesheet” type=”text/css” /> But then, it seems that superfish-modified.css under themes/mytheme/css/blocktopmenu is not loaded and all styles for the top menu disapear. Do you have any idea what is missing? Link to comment Share on other sites More sharing options...
Atch Posted March 18, 2012 Share Posted March 18, 2012 if you use the mobule top menu of Julien Breux, you have two CSS. V++ Atch Link to comment Share on other sites More sharing options...
prestaZ Posted March 19, 2012 Share Posted March 19, 2012 I am using Prestashop's new theme, I guess it's horizontal menu is the module from Julien Breux... But there is only one CSS file - superfish-modified.css. Is there any other way to apply my own styles without changing original files? Should I put all of my styles into global.css (under themes/mytheme)?? How is everybody else doing this? Link to comment Share on other sites More sharing options...
prestaZ Posted March 27, 2012 Share Posted March 27, 2012 This is the last post I will make on this subject. If there are no further suggestions I will go ahead and change the original superfish-modified.css file under prestashop/modules/blocktopmenu/css (core file!). This issue was rather frustrating. On the one hand, Prestashop experts complain about people buiding their themes by editing the core files, but on the other hand, there is no specific explanation on how not to do so... There are many themes to download - all with an individual style. How is it possible without putting all CSS into global.css or html tags? I am sure someone who perfectly understands PHP and Smarty would know the right answer right away, but for an absolute beginner without any help it is quite impossible. Link to comment Share on other sites More sharing options...
prestaZ Posted March 27, 2012 Share Posted March 27, 2012 Please disregard above since I found the solution!!!!! :D :D :D To share with you: As mentioned in another place, it is not possible to override CSS files by putting them under themes directory (only). I was advised that it is only possible to do so for .tpl files. If one wants to override a CSS file, it is necessary to override the .tpl file first and then change it's reference / link to ones own CSS file. This can be done by following procedure: 1. Copy .tpl file of original module (from prestashop/modules) to your themes' module directory (depending on module you need to create a new folder with the same name as in the root directory). 2. Change the code (for the example of blocktopmenu) <link rel="stylesheet" type="text/css" href="{$this_path}css/superfish-modified.css" media="screen" /> to <link href="{$css_dir}modules/blocktopmenu/superfish-modified.css" rel="stylesheet" type="text/css"/>. ->>> This solution was provided by Adrian Nethercott (rocky). Thank you so much!! <<<- 3. Copy CSS file of the module from prestashop/modules/.../css to your themes' css directory (you need to create a new folder with the name of the module). Then it should work! 4. Note that all images referenced by the CSS file (e.g. backgrounds) will be deleted / not found due to new location of CSS file. If you want to use the same images (or your own), you have to create a folder for images in the same place as you have your CSS file. Then, you will have to change the references in CSS file from "../img/" to "img/". :D :D :D :D :D :D :D :D :D Done! 2 Link to comment Share on other sites More sharing options...
inpixelitrust Posted June 23, 2012 Share Posted June 23, 2012 Hey, I just wanted to thank prestaZ, I'm new to Prestashop and this solution saved my day it now works like a charm Link to comment Share on other sites More sharing options...
pixelkai Posted October 17, 2012 Share Posted October 17, 2012 Please disregard above since I found the solution!!!!! :D :D :D To share with you: As mentioned in another place, it is not possible to override CSS files by putting them under themes directory (only). I was advised that it is only possible to do so for .tpl files. If one wants to override a CSS file, it is necessary to override the .tpl file first and then change it's reference / link to ones own CSS file. This can be done by following procedure: 1. Copy .tpl file of original module (from prestashop/modules) to your themes' module directory (depending on module you need to create a new folder with the same name as in the root directory). 2. Change the code (for the example of blocktopmenu) <link rel="stylesheet" type="text/css" href="{$this_path}css/superfish-modified.css" media="screen" /> to <link href="{$css_dir}modules/blocktopmenu/superfish-modified.css" rel="stylesheet" type="text/css"/>. ->>> This solution was provided by Adrian Nethercott (rocky). Thank you so much!! <<<- i struggle with the same problem but in my module tpl files there is no <link> tag as mentioned above so this solution does not work for me .... but i guess this post ist outdated and refers to an older version.... ...the css reference seems to be now in the module php file so i tried to change the link there $this->context->controller->addCSS(($this->_path).'blockuserinfo.css', 'all'); i just added the reference to my changed css $this->context->controller->addCSS(($this->_path).'../themes/newtheme/modules/blockuserinfo/blockuserinfo.css', 'all'); but it does not work too what i do wrong? Link to comment Share on other sites More sharing options...
Sharak Posted October 23, 2012 Share Posted October 23, 2012 I found the solution on french forum (really, Presta team, you should at least add google translator, cause it's a mess with all this languages ). There's no need to change any core files of blocktopmenu module. Simply place modified .css file in this location: themes/<mytheme>/css/modules/blocktopmenu/css/superfish-modified.css Works fine on presta 1.5.1.0 2 Link to comment Share on other sites More sharing options...
tomlefol Posted October 24, 2012 Share Posted October 24, 2012 (edited) Ok yeah it's the sub-directory /css/ the problem... Other core modules put their css files into root module dir and that one don't. So if you follow tutorial or guide to customize module it won't work. Presta team, it's messy work ! To that specific module put your css into /css/ sub-dir and that all. So, like Sharak say, you could place it into /mytheme/css/modules/blocktopmenu/css/ Edited October 24, 2012 by tomlefol (see edit history) Link to comment Share on other sites More sharing options...
timas Posted January 21, 2013 Share Posted January 21, 2013 (edited) works for me too: change tpls in site/themes/mytheme/modules change css in site/themes/mytheme/css/modules change imgs by changing the img path in css For example: background:url(../../../modules/blockcategories/img/arrow_right_2.png) no-repeat 10px 10px transparent change to background:url(../modules/blockcategories/img/arrow_right_2.png) no-repeat 10px 10px transparent dont forget to put the img in site/themes/mytheme/css/modules/img Edited January 21, 2013 by timas (see edit history) Link to comment Share on other sites More sharing options...
tomvaneyck Posted January 15, 2014 Share Posted January 15, 2014 I found the solution on french forum (really, Presta team, you should at least add google translator, cause it's a mess with all this languages ). There's no need to change any core files of blocktopmenu module. Simply place modified .css file in this location: themes/<mytheme>/css/modules/blocktopmenu/css/superfish-modified.css Works fine on presta 1.5.1.0 I've been searching for this solution for hours! Putting the superfish-modified.css in that location did it! Thanks a lot! themes/<mytheme>/css/modules/blocktopmenu/css/superfish-modified.css Works in presta 1.5.6.1 Link to comment Share on other sites More sharing options...
PBo34 Posted February 2, 2014 Share Posted February 2, 2014 Thanks, I was really pissed off with this problem, you unlocked the situation 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