IGNITER Posted April 19, 2014 Share Posted April 19, 2014 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 More sharing options...
bellini13 Posted April 19, 2014 Share Posted April 19, 2014 you can only override tpl files in that folder. module css files need to go /themes/<theme_name>/css/modules/<module_name>/ this only works if the module was coded properly to allow overrides 1 Link to comment Share on other sites More sharing options...
IGNITER Posted April 19, 2014 Author Share Posted April 19, 2014 (edited) 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 April 19, 2014 by IGNITER (see edit history) Link to comment Share on other sites More sharing options...
bellini13 Posted April 19, 2014 Share Posted April 19, 2014 show me an example an the css that is referencing an image, i need to see the img url Link to comment Share on other sites More sharing options...
IGNITER Posted April 19, 2014 Author Share Posted April 19, 2014 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 More sharing options...
vekia Posted April 19, 2014 Share Posted April 19, 2014 store images in /themes/<theme_name>/css/modules/<module_name>/ not in original module directory Link to comment Share on other sites More sharing options...
bellini13 Posted April 19, 2014 Share Posted April 19, 2014 as Vekia said. the css is looking for the image in the current directory as the css file. Link to comment Share on other sites More sharing options...
IGNITER Posted April 19, 2014 Author Share Posted April 19, 2014 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 More sharing options...
Dh42 Posted April 19, 2014 Share Posted April 19, 2014 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 More sharing options...
IGNITER Posted April 19, 2014 Author Share Posted April 19, 2014 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 More sharing options...
bellini13 Posted April 19, 2014 Share Posted April 19, 2014 but you provided the following style before... which is why i said to put it in the same directory background:url(gray_pager.png) no-repeat 0 -20px; Link to comment Share on other sites More sharing options...
IGNITER Posted April 20, 2014 Author Share Posted April 20, 2014 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 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