Jump to content

Unable to override module


Recommended Posts

Hello prestashopers,

I am beating my head against the wall for a while.

The reason is module override more precisely the new theme that I am creating.

 

I have noticed that there is a folder /themes/_my_new_theme_/modules.

I copy the original files from /modules/blocktopmenu folder, after some modification I uploaded only the CSS files in /themes/_my_new_theme_/modules/blocktopmenu.

 

According to this article --> http://doc.prestashop.com/display/PS15/Overriding+default+behaviors I should delete the cache file located /cache/class_index.php.

After deletion of class_index.php the Presta regenerates it again, but I am unable to see any of the changes that I made.

The changes are only visible when I upload the CSS files directly to /modiles/blocktopmenu folder.

 

What I am missing?

I will appreciate some help here.

 

Link to comment
Share on other sites

I don't know how to thank you about that :)

 

It is working but unfortunately It can't load the images located in the module dir.

Where I need to put the image content of the module in order to display properly?

Should I correct the path manually?

 

Thanks!

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

For example this one from homeslider module

background:url(gray_pager.png) no-repeat 0 -20px;

Normally when the bx_styles.css and the other files are located in /modules/homeslider/ everything is fine.

It is different story when I move the module files in /themes/_theme_/modules and bx_styles.css to themes/_theme_/css/modules/homeslider/ there is a large image with '?' symbol appearing.

Link to comment
Share on other sites

Nope, I already tried that by following that logic, but it didn't do the trick.

It is able to slide the images that are located in its '/images/' folder but the bullets backgrounds are missing.

 

Same with the 'blocktopmenu' module.

 

I even tried to move the images in the /themes/_theme_/img/ folder and recall them accordingly in bx_styles.css with the path: ../img/gray_pager.png and it didn't work?!

 

How does Prestashop manages the image links?

Link to comment
Share on other sites

The easiest way to see where it is trying to load the images is to load the page, inspect it in chrome, and see where the 404 error for the image is pointing too. Then put the image in that location. 

Link to comment
Share on other sites

Damn it ... it was much easier than I thought.

I put the image files in the '/themes/_theme_/img' folder.

Since 'bx_styles.css' file is located in '/themes/_theme_/css/modules/homeslider' in order for the CSS file to touch the images it must up 3 folders up over the directory tree.

The image link is: 

background:url(../../../img/gray_pager.png) no-repeat 0 -20px;

Thank you for participating in the topic ... strong Prestashop community as usual :)

Link to comment
Share on other sites

For some reason even when I put the image files next to the CSS file in order to preserve the path, the images don't show up.

As a result it's empty space, not have the '?' mark image.

I guess it is because of storing the images in the Presta's CSS folder /themes/_theme_/css/modules/_module_ .

It's kind of odd why the decided to made the override not for whole of the files in the module folder, I guess they might fix it in the next versions.

To me overriding is very convenient and it seems a good idea.

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