Flukas
Flukas

Reputation: 13

Prestashop 1.7 admin theme css overrides

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?

Upvotes: 0

Views: 7073

Answers (3)

Add the overrides.css file location to the function named setMedia in classes/controller/AdminController.php

public function setMedia($isNewTheme = false)
{
    if ($isNewTheme) {
        $this->addCSS(__PS_BASE_URI__ . $this->admin_webpath . '/themes/default/css/overrides.css', 'all', 1);

Upvotes: 0

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.

Table PS_tab in PHPMyAdmin

By example, I have this vehicle file custom module:

Menu including a custom module

If I set the row with the class_name "V2vVehicleFile" to active = 0 (false), then the whole menu (including its submenus) disappear.

Vehicle file menu has disappeared

Now, if I set the row with the class_name "AdminVehicleMake" to active = 0 (false), then only the submenus named "Vehicle make" disappear.

Only the vehicle make sub menu has disappeared

Upvotes: 1

sadlyblue
sadlyblue

Reputation: 2987

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.

Upvotes: 1

Related Questions