问题
So I'm trying to modify the layout of theme.yml in a PrestaShop theme. I comment out the following:
hooks:
modules_to_hook:
displayFooter:
# - ps_linklist
# - ps_customeraccountlinks
- ps_contactinfo
And then I save and FTP the file. The FTP succeeds.
However, the linklist and customeraccountlinks hooks are still displayed in the footer on client browsers.
I've tried to force refresh on the client browser, also to clear cache in back office. Neither of these work.
How do I propagate this updated theme.yml ?
回答1:
The theme.yml is only useful when first installing a theme, any changes you make to it will not do anything after the theme has been installed.
However it is easy to either remove the unwanted modules on the "installed modules" page (click the little arrow next to the module and select "uninstall") or unhook the module from the, in your case, "displayFooter" hook on the "Positions" page which is found in the submenu of "Design" in Prestashop 1.7.x
回答2:
You can reset a theme to default within Design -> Theme & Logo -> Reset to defaults, but in this case, you will apply all settings that are written in theme.yml, so be sure that everything consistents your requirements there.
回答3:
If you want reload your configuration :
- Modify your theme.yml
- Delete the file into ROOT_FOLDER/config/themes/your theme/shop*.json
- Refresh your page, prestashop going to regenerate the config json file for your theme
回答4:
You can use the button "Reset to defaults" in the theme Backoffice after updating the file theme.yml but make sure in this file that you must remove any name related to this module and adding it in disabling section "to_disable".
For example : I want to disable the module "ps_mainmenu", you have to comment it out in the hook(s)
displayTop:
# - ps_mainmenu
- ps_searchbar
After this you have to add it in
modules:
to_disable:
- ps_mainmenu
来源:https://stackoverflow.com/questions/47586122/updating-theme-yml-in-prestashop