Jump to content

How does module reset work and how does it affect CSS outside the module?


xbhy

Recommended Posts

Hello,

recently I was trying to fix an issue with the Cart block and I performed a reset of the module. Due to my limited knowledge of Prestashop, this turned out to be a rather big mistake. The site was having the Cart block in the displayNav instead of the displayTop position. Of course, the reset messed up the design. After putting the Cart block back to the displayNav position, I realized that in order to make it look like before, I need to change a lot of CSS, and not just the module's CSS, but stuff in other CSS and TPL files too, as far as I understand it e.g. from here: https://mypresta.eu/question/cart-block-in-navigation-block-issue/

This is what I don't get: the way the module looked before the reset must have been influenced by CSS in several files which don't belong to the module. How could the reset identify and revert these modifications? It seems unlikely it would. I must be missing something.

Unfortunately, I don't have a backup of the module before the reset. Perhaps the changes to global.css etc. were included in separate files in the module's folder, that override the values in the main global.css etc.?

Thank you very much for any explanation on how this works.

Regards,

Petr

 

Link to comment
Share on other sites

Hi,

If you only reset a module, it has no influence on any CSS file, neither in its directory, nor in your theme.

It's possible that the module is no longer grafted in the right place, because its location depends on the configuration made in the theme.

Normally, only a change of hook point or position should be necessary.

However, if you reload the archive of a module, it will overwrite any modification, that's why for tpl, css and js files we do this kind of adaptation in an overload of the file in the theme.

 

Link to comment
Share on other sites

5 hours ago, ComGrafPL said:

Was it on classic theme? Can you just restore store backup ( not just module ) before changes?

Yes, it is the default-bootstrap theme on PS 1.6, sorry for not mentioning that earlier.

I have to ask the guy I work for on this whether he has a backup. Since I my understanding was that the module reset shouldn't change any files, I was stupid enough not make a backup.

Link to comment
Share on other sites

5 hours ago, Mediacom87 said:

Hi,

If you only reset a module, it has no influence on any CSS file, neither in its directory, nor in your theme.

It's possible that the module is no longer grafted in the right place, because its location depends on the configuration made in the theme.

Normally, only a change of hook point or position should be necessary.

However, if you reload the archive of a module, it will overwrite any modification, that's why for tpl, css and js files we do this kind of adaptation in an overload of the file in the theme.

 

Hi,

you mean reload the archive of a module, as in uninstalling and reinstalling in the administration, or re-uploading the files via FTP? I did neither of that, I only selected the Reset option for the Cart block in the List of modules. I still don't understand, how this could affect the font sizes, margins, padding etc. of the Cart.

Link to comment
Share on other sites

il y a une heure, xbhy a dit :

you mean reload the archive of a module, as in uninstalling and reinstalling in the administration, or re-uploading the files via FTP? I did neither of that, I only selected the Reset option for the Cart block in the List of modules. I still don't understand, how this could affect the font sizes, margins, padding etc. of the Cart.

As the module has changed position, maybe the design that should be applied to it is no more.

Or, the names identifying the elements have changed, I confess I have not tested to compare.

After that, as I don't know your CSS or your site, it's difficult to say more.

Link to comment
Share on other sites

8 minutes ago, Mediacom87 said:

As the module has changed position, maybe the design that should be applied to it is no more.

Or, the names identifying the elements have changed, I confess I have not tested to compare.

After that, as I don't know your CSS or your site, it's difficult to say more.

Thank you. It's strange that the design would not be applied even after the module is hooked back to the displayNav position. Anyway, the site is gagi.cz (unfortunately, a customer registration is necessary to see anything meaningful).

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