问题
I am trying to modify the PS 1.7 admin theme - simply to hide a few options and menu items.
I modified ./adminFolder/themes/default/css/override.css
And it works everywhere, except at Catalog/Products and Modules - as if there were no overrides.
How can I get the css overrides to work globally in the admin area?
回答1:
If you want to hide menu/sub-menus, you can set the visibility from within the database in the table [PREFIX]_tab
(default is ps_tab
).
The top menu has 0 for id_parent
and submenus has a value superior to 0.
By example, I have this vehicle file custom module:
If I set the row with the class_name
"V2vVehicleFile" to active = 0
(false), then the whole menu (including its submenus) disappear.
Now, if I set the row with the class_name
"AdminVehicleMake" to active = 0
(false), then only the submenus named "Vehicle make" disappear.
回答2:
The product controller is already in the new system (symfony).
Looking at the source code you can see that it uses 5 css:
/modules/welcome/public/module.css
/admin/themes/new-theme/public/theme.css
/js/jquery/plugins/chosen/jquery.chosen.css
/admin/themes/default/css/vendor/nv.d3.css
/admin/themes/default/css/bundle/right-sidebar.css
The overrides.css is only for the "old theme". And I don't know of any for the new one.
So either you change one of these, and run the risk of being overwritten on upgrade. Or override the AdminController->setMedia($isNewTheme = false)
to add your custom css. Or use the Hook::exec('actionAdminControllerSetMedia');
in a module to add it.
来源:https://stackoverflow.com/questions/42665797/prestashop-1-7-admin-theme-css-overrides