Jump to content

Blocktopmenu can't override css


Recommended Posts

Hello,

 

I am using latest prestashop with new 1.5 design theme.

I cannot override css files for module blocktopmenu,

 

original css:

http_pub/modules/blocktopmenu/css/superfish-modified.css

 

my override css:

http_pub/themes/prestashop_new/modules/blocktopmenu/css/superfish-modified.css

 

Why it's not working and how can i fix this?

 

Thanks.

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...
  • 1 month later...
  • 2 months later...
  • 2 months later...

There is an issue with that module. For some reason, the css is embedded directly into the tpl file! You'll have to whether:

1- Edit the php file and call the addcss function in hookHeader, adding the css from there, so that you can thenoverride it in your themes

2- manually edit the superfish-modified.css inside the css folder of the module everytime

 

hope this helps

 

Cheers!

Link to comment
Share on other sites

  • 5 months later...

Great little video, Does anyone have any suggestions when using the multi store feature?

 

I have two clients that are using the prestashop default theme and I need to change the colour of the top menu. which I cant currently do as the CCS is located within the module. I can't change the path as it will do this for both sites....

Any suggestions would be great.

 

Regards

Matt

Link to comment
Share on other sites

I would suggest making a copy of the default theme for each store instance (defaut1 and default2). Then assign each theme to a store. That will allow you to have both stores use the default theme, but have customizations specific to the store.

 

That also helps protect your changes during future upgrades, since the default theme will likely be changed in future versions of prestashop. You risk losing your customizations unless you are careful.

Link to comment
Share on other sites

I would suggest making a copy of the default theme for each store instance (defaut1 and default2). Then assign each theme to a store. That will allow you to have both stores use the default theme, but have customizations specific to the store.

 

That also helps protect your changes during future upgrades, since the default theme will likely be changed in future versions of prestashop. You risk losing your customizations unless you are careful.

 

Thanks for your reply, I was going to do this but the CSS for the Blocktopmenu is stored within the module - not within "theme/modules folder"

 

Any other suggestions? ......... Can you duplicate the module?

Link to comment
Share on other sites

as i previously recommended, then you override the module template or css within the theme.

 

Sorry I don't understand, if the blocktopmenu stores its CSS within the module then overriding it to Themes > Shop A > Modules will still change it for both sites? Unless it automatically looks in Themes > Modules if it cant find one ? which I doubt!

 

I've read you're previous solution higher up within this thread which will work if your using a single Shop.

 

Regards

Matt

Link to comment
Share on other sites

My understanding is that you want to share a theme across 2 mutli-stores, but that each store might have subtle differences. You also said that a module has embedded CSS directly into the modules tpl file.

 

So my response "do both" is saying to implement both suggestions from my previous posts...

1) copy the default theme and create 2 new themes "store1" and "store2". Assign "store1" theme to "store1", and "store2" theme to "store2". At this point both stores are using the "same" default theme, agreed? Now apply whatever custom changes to each respective theme.

 

2) Then copy the module's tpl file to your themes module folder, which will override the modules default behavior. Now change the embedded CSS to meet your requirements.

Link to comment
Share on other sites

  • 4 weeks later...

Quick and dirty solution: place your override file in your template/css/modules/blocktopmenu just as it should be and call it in your header template file AFTER the loop that calls all the other CSS files. You'll just have to write the override file slightly differently to override previous styles as you're not starting with a blank canvas.

 

{if isset($css_files)}
{foreach from=$css_files key=css_uri item=media}
<link href="{$css_uri}" rel="stylesheet" type="text/css" media="{$media}" />
{/foreach}
{/if}
<link href="{$css_dir}modules/blocktopmenu/superfish-modified.css" rel="stylesheet" type="text/css"/>

Edited by goosedesign (see edit history)
Link to comment
Share on other sites

  • 6 months later...

@goosedesign

I think a solution based on your post that (I think) is the best way to make all css override without problem:

1. make a this folder: /themes/your_theme/css/custom then put inside a file called "custom.css"

2. write this code in the header.tpl after the css loop:

<link href="{$css_dir}custom/custom.css" rel="stylesheet" type="text/css"/>

 

This way you can overwrite each css rule in of each css file, only in one "custom" file.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
  • 4 weeks later...

the one he quoted, placing the css there:

/themes/newtheme/css/blocktopmenu/css/superfish-modified.css

not the only CSS that does that anyway, I got a couple others that won't be used from my custom theme, but they're not from stock prestashop.

 

Well I found a funny stock one: the adresses.css isn't overidden either.

Edited by venom2506 (see edit history)
Link to comment
Share on other sites

/themes/newtheme/css/blocktopmenu/css/superfish-modified.css

 

Try "/themes/<yourtheme>/css/modules/<module-name>/css/<stylesheet-name>.css" or "/themes/<yourtheme>/css/modules/<module-name>/<stylesheet-name>.css" in case the original css was not in a "css" subfolder of the module.

  • Like 1
Link to comment
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...