dalex Posted May 25, 2017 Share Posted May 25, 2017 I am trying to customize WHMCS admin area and the changes I am saving aren't being applied to WHMCS. Your help is appreciated! CSS FILE: whmcs/administration/templates/login.css body { background-color: #fff !important; } FILE: whmcs/administration/templates/lara/css/all.min.css table.datatable th { border-radius:0px; background-color:#3076be; } IMAGES I also uploaded a new image called whmcs.png and placed it in this folder (whmcs/assets/img) overwriting the original image but the new image isn't displaying on the login screen. 0 Quote Link to comment Share on other sites More sharing options...
dalex Posted May 25, 2017 Author Share Posted May 25, 2017 I checked the documents and it says nothing about customizing the admin area. Please help! 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 25, 2017 Share Posted May 25, 2017 if it were me, what i'd do is customise login.tpl to use a custom.css... <link href="templates/login.min.css" rel="stylesheet"> <link href="templates/custom.css" rel="stylesheet"> that way, the css won't get lost during an update - though you may potentially have to add the link back to the custom.css file after an update... but I can't really see any way around that. and then in custom.css... body { background-color: #fff !important; } with regards to the Lara change, perhaps use the admin hook I posted in the thread below... https://forum.whmcs.com/showthread.php?111051-Change-Tab-Color-and-Text&p=452667#post452667 that will automatically add a link in your admin header to a custom.css file - though perhaps you may need to change the link in the hook to /css/custom.css - then it's just a matter of creating the custom.css file and adding your code into it. the advantage to this is that these changes should remain when you update WHMCS and/or Lara in the future. 0 Quote Link to comment Share on other sites More sharing options...
dalex Posted May 25, 2017 Author Share Posted May 25, 2017 Questions: 1) Where do I add: <link href="templates/custom.css" rel="stylesheet"> in the PHP file? I assume the PHP file I need to update is: whmcs/admin/login.php 2) How do I make the admin login page show the image I uploaded and overwrote the original whmcs image? - - - Updated - - - I tried creating a hook and it didn't work. Inside includes/hooks I created a file called admincss.php It has the below code in it: <?php function admin_custom_css_hook($vars) { $currenttemplate = $vars['template']; $head_return = ''; $head_return = '<link href="templates/'.$currenttemplate.'/custom_css.css" rel="stylesheet" type="text/css" />'; return $head_return; } add_hook("AdminAreaHeadOutput",1,"admin_custom_css_hook"); The css for custom_css.css is located here: public_html/whmcs/admin/templates/lara/css/custom_css.css 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 25, 2017 Share Posted May 25, 2017 Questions:1) Where do I add: <link href="templates/custom.css" rel="stylesheet"> in the PHP file? I assume the PHP file I need to update is: whmcs/admin/login.php forget about the php files in the admin area, nearly all of them are encoded, so access is not possible... you would add the line to whmcs/admin/templates/login.tpl - the link to login.min.css is already there, so just add the link to the custom.css file after it... 2) How do I make the admin login page show the image I uploaded and overwrote the original whmcs image? I just renamed the original to whmcs2.png, uploaded the amazon logo, renamed it to whmcs.png and refreshed the login page in the browser... you might be running into a browser caching issue. I tried creating a hook and it didn't work. Inside includes/hooks I created a file called admincss.php The css for custom_css.css is located here: public_html/whmcs/admin/templates/lara/css/custom_css.css the hook will need to use the correct path... $head_return = '<link href="templates/'.$currenttemplate.'/css/custom_css.css" rel="stylesheet" type="text/css" />'; 0 Quote Link to comment Share on other sites More sharing options...
dalex Posted May 25, 2017 Author Share Posted May 25, 2017 I cleared my cache and all is working now except for the login css for login.tpl 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 25, 2017 Share Posted May 25, 2017 I cleared my cache and all is working now except for the login css for login.tpl is it loading the css file? 0 Quote Link to comment Share on other sites More sharing options...
dalex Posted May 25, 2017 Author Share Posted May 25, 2017 CSS location: public_html/whmcs/admin/customlogin.css I added the css line to: whmcs/admin/templates/login.tpl How do I tell if a css file is loading? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 25, 2017 Share Posted May 25, 2017 i'd have put the css file in the same folder as login.tpl to avoid path issues... or change the path in the .tpl 0 Quote Link to comment Share on other sites More sharing options...
dalex Posted May 25, 2017 Author Share Posted May 25, 2017 That did it! How would I go about creating a hook for the login page title? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 25, 2017 Share Posted May 25, 2017 How would I go about creating a hook for the login page title? I doubt you can - quick way would be to just edit it in login.tpl 0 Quote Link to comment Share on other sites More sharing options...
dalex Posted May 25, 2017 Author Share Posted May 25, 2017 Ok, Thanks! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.