Jump to content

override css blocktopmenu


Recommended Posts

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

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

  • 2 months later...

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

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

  • 2 weeks later...

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

Please disregard above since I found the solution!!!!! :D :D :D :D :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 :D :D :D :D :D :D :D :D :D

Done!

  • Like 2
Link to comment
Share on other sites

  • 2 months later...
  • 3 months later...

Please disregard above since I found the solution!!!!! :D :D :D :D :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.... :unsure: ...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

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

  • Like 2
Link to comment
Share on other sites

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

  • 2 months later...

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

  • 11 months later...

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

  • 3 weeks later...

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...