Add JS/CSS scripts to cPanel theme

Alir3z4

Registered
Jan 16, 2015
2
0
1
cPanel Access Level
Root Administrator
Is it possible to modify cPanel theme for adding custom JS or CSS scripts to the header or the footer of the cPanel theme.

One of the purpose of doing this would be adding Google Analytics javascript or web site metrics.

I read that it could be possible by cloning the theme and modify and upload a new one with the modified version. The downside would be that we have to do cloning, modifiying and uploading the theme each time that the original theme has a fix.

The branding section of the WHM only allows changing very limited area of the cPanel.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,220
463
Hello :)

I am happy to see you were able to find answers to your questions. Thank you for updating us with the outcome.
 

cPanelAdamF

cPanel Product Owner
Staff member
Mar 21, 2013
259
80
153
Houston TX
cPanel Access Level
DataCenter Provider
Twitter
In this scenario, definitely don't maintain your own fork of Paper Lantern as that would mean that you'd be taking on all of the responsibility for keeping the UI up to date and secure.

Instead, yeah, utilize the global_footer.html.tt UI Include to include your own content (in this case the <script> tag that you're looking for) onto every page of the interface.