me-and-prestashop Posted October 29, 2014 Share Posted October 29, 2014 I need to add the employee profile as a class in the body tag of Back Office. Editing the file adminXXXX/themes/default/template/header.tpl seem to do just this. On line 110: <body class="ps_back-office{if $employee->bo_menu} page-sidebar{if $collapse_menu} page-sidebar-closed{/if}{else} page-topbar{/if} {$smarty.get.controller|escape|strtolower} {if ((int)Context::getContext()->employee->id_profile) == 5}profile5{/if}"> Instead of editing this file, it is probably better to make this an override. I tried to make a copy of the header.tpl and place it inside (www)/override/controllers/admin/templates/ but the override did not happen. Do I need to make some folder structure inside the override folder? Or do I use some other override folder? Do I need to delete cache/class_index.php? Also I need to add new css rules to the admin theme. What is best practice for adding custom css to the default admin theme? Why? I need to hide certain elements in the BO for this profile. Since the profile permission is not specific enough. E.g. the employees need to configure some modules without being able to update, disable, delete the module (ref. this forum post) Any help would be appreciated Link to comment Share on other sites More sharing options...
vekia Posted October 29, 2014 Share Posted October 29, 2014 prestashop doesnt handle override of .tpl files you can override only logic files, and MODULEs .tpl files http://doc.prestashop.com/display/PS15/Overriding+default+behaviors Link to comment Share on other sites More sharing options...
me-and-prestashop Posted October 30, 2014 Author Share Posted October 30, 2014 (edited) Thank you for the help and clarification. I will have to edit the admin .tpl file then. When adding new css rules to the admin theme I found the adminXXX/themes/default/css/overrides.css and hope this is not overwritten when updating later. I will just have to save a copy/backup of the edited adm theme files for updates. On most modules the shop editor/employee will have access to the functionality inside admin without specific access to view or edit the module. But employees will need permissions to configure some modules - like the "Theme configurator" module. My solution so far is to remove the module menu item in admin menu (using profile permission) and hide the #moduleContainer (using CSS) in case the employee finds the link to the modules page in the breadcrumbs. How do other Prestashop devs prevent employees from updating, disabling, deleting modules they have access to? (Sometimes it would be useful to give access to some configuration options only - like the bottom part (banners) of the "Theme configurator" module. Is this done with customization of controllers/template files or by using other more specific modules?) Edited October 30, 2014 by me-and-prestashop (see edit history) Link to comment Share on other sites More sharing options...
nuclearholocausto Posted January 31, 2016 Share Posted January 31, 2016 Have you tried changing employee permissions? Link to comment Share on other sites More sharing options...
me-and-prestashop Posted June 9, 2016 Author Share Posted June 9, 2016 Have you tried changing employee permissions? Yes. It is not specific enough 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