Jump to content

Customizing WHMCS Administration Area Issues


dalex

Recommended Posts

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.

Link to comment
Share on other sites

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;
}

Rjs3W1j.png

 

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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" />';

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated