How to create custom groups/sections in cPanel?

Funkadelic

Well-Known Member
Feb 10, 2006
73
0
156
Trying to find out how to create my own groups/sections, like the Preferences, Mail etc.. groups that have the icons in them.
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
Trying to find out how to create my own groups/sections, like the Preferences, Mail etc.. groups that have the icons in them.
If you want the custom groups to look/behave like other sections in the cPanel interface, the only way to do that right now is with a custom theme where the appropriate YUI hooks are implemented to accommodate your new sections.
 

Funkadelic

Well-Known Member
Feb 10, 2006
73
0
156
and thats exactly what I've done David...

However the problem is, I don't know which files I need to edit in order to have this done, there is no other post on this forum where you have given instructions on how to create your own section/group.

I have already used: http://www.cpanel.net/plugins/devel/installgen.html to generate an icon and I put that plugin into a group that doesn't exist, so now I have a bunch of icons in a box for the name 'partners' and that box does not have a title attached to it, so I need to find out how to add a title to this box.

Additionally the problem I encounter is that when I use the 'unregister' command to unregister an icon, it says it is successful and all but the icons aren't deleted from the theme and I don't really know why.
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
and thats exactly what I've done David...

However the problem is, I don't know which files I need to edit in order to have this done, there is no other post on this forum where you have given instructions on how to create your own section/group.

I have already used: http://www.cpanel.net/plugins/devel/installgen.html to generate an icon and I put that plugin into a group that doesn't exist, so now I have a bunch of icons in a box for the name 'partners' and that box does not have a title attached to it, so I need to find out how to add a title to this box.

Additionally the problem I encounter is that when I use the 'unregister' command to unregister an icon, it says it is successful and all but the icons aren't deleted from the theme and I don't really know why.
There's a difference between making a plug-in and making a theme.

When you uninstall a plug-in, you may wish to refresh the sprites to ensure the icon is fully removed. If that is not working for you, you may wish to submit a support ticket at: http://tickets.cpanel.net/submit

As for creating a theme, I recommend copying the contents of /usr/local/cpanel/base/frontend/x3 to another folder at the same level (for example: /usr/local/cpanel/base/frontend/my-x3) and editing the files in the copy to suit your needs. It's just a series of HTML pages and the code is fairly simple to understand.
 

Funkadelic

Well-Known Member
Feb 10, 2006
73
0
156
David, yes I have already done everything you have stated previously.

It would be great if you could answer my question though.

Step by step, how do I add another section?
 
Last edited:

Funkadelic

Well-Known Member
Feb 10, 2006
73
0
156
Additionally, what files outside of the theme does the unregister_plugin remove when you run it? I have been studying it trying to understand as it does not appear to be working correctly.
 
Last edited:

s.a.

Active Member
PartnerNOC
Aug 16, 2007
35
0
56
Toronto, Canada
If you want the custom groups to look/behave like other sections in the cPanel interface, the only way to do that right now is with a custom theme where the appropriate YUI hooks are implemented to accommodate your new sections.
Any hints on where to start digging? Is display groups list stored somewhere in theme files? Can't seem to find it.
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
Any hints on where to start digging? Is display groups list stored somewhere in theme files? Can't seem to find it.
I started to tinker with things and I found actually it is possible to incorporate this into branding rather than themes.

In the Branding Editor go to Edit HTML pages then edit index.html.

At line 224 (assuming you have not previously customizing this file) you will see

HTML:
<div id="boxes">
The boxes section is where you see the feature boxes (sections) of the X3 interface on the homepage (a simple check with Firebug will confirm this).

Looking below that line of code is the API code for inserting all the icons from plugins and whatnot. However, if you just want to hard-code some items, you can create a custom section by simply using this code.

HTML:
<!-- custom code here -->
<div id="davidg" class="itembox">
<div id="davidg-bdrop" class="celldrop"> </div>
<div class="cellbox">
<h6 id="davidg-header" class="itembox" title="Double click to collapse/expand. Click to drag." style="clear:none;" ondblclick="rollbox(this);" class="ie-hover"><div id="davidg-expander" class="box-collapse-control" style="float:right" onClick="rollbox(this);"> </div>My custom section</h6>
<div id="davidg-body">
Let's see what we can put here...
<div class="clearit"> </div>
</div>
</div>
<div id="davidg-adrop" class="celldrop"> </div>
</div>
<!-- end of custom code -->
Known issues with this code as it stands right now:
- The location is not stored like the other feature boxes (as this is not using the APIs that access and use that information)
- You can't add icons for plug-ins to this feature box.

I figure it's a good running start for those that want this functionality.
 

s.a.

Active Member
PartnerNOC
Aug 16, 2007
35
0
56
Toronto, Canada
Awesome! This will work even better than creating a custom theme - no worries if some theme need to be updated.

Thanks David!
 

s.a.

Active Member
PartnerNOC
Aug 16, 2007
35
0
56
Toronto, Canada
Yeah, right. They're going to give it all up along with process manager plugin code and cpu limits implementation (oh, how i'd like to have this on my servers!). :)
 

Funkadelic

Well-Known Member
Feb 10, 2006
73
0
156
I got it...

1. Edit Attic/english.orig
Insert the name of the group
example:
headset=Account Settings

2. Edit dynamicui.conf

At the top of the file are the different group settings, just copy and paste another group and paste it where you want your section to be.
example:
description=>$LANG{'headset'},file=>group_headset,group=>headset,groupdesc=>$LANG{'headset'},grouporder=>1,imgtype=>icon,subtype=>img,height=>32,type=>image,width=>32
change the 'headset' to the variable that you entered in for the first file. Additionally feel free to modify the group order number to specify where you want the section to be.

3. Edit lang/english and if you want, lang/english-utf8
Insert the same info you inserted into the first file in step #1.
example:
headset=Account Settings
If you are using other languages then you should edit the appropiate language file.

4. Upload and your all done!

Note: If you are going to be using http://www.cpanel.net/plugins/devel/installgen.html

Make sure you edit the group variable to the group you want your icon to be in, for example, the above setup would lead me to put the group being 'headset' and therefore any plugins I make would appear under a title that says 'Account Settings'.
 

Funkadelic

Well-Known Member
Feb 10, 2006
73
0
156
I know this post is super old but it still surprises me that cPanel hasn't made creating groups/icons any easy. You would think there would be some easy way to do this but still have to do is the old way.

I found it a big hassle in maintaining an outside theme and would like to try using the branding editor. Using David's code I inserted it into index.html and that made a new box with the text inside it no problem, but how do I get the icons to go inside that box?

I started to tinker with things and I found actually it is possible to incorporate this into branding rather than themes.

In the Branding Editor go to Edit HTML pages then edit index.html.

At line 224 (assuming you have not previously customizing this file) you will see

HTML:
<div id="boxes">
The boxes section is where you see the feature boxes (sections) of the X3 interface on the homepage (a simple check with Firebug will confirm this).

Looking below that line of code is the API code for inserting all the icons from plugins and whatnot. However, if you just want to hard-code some items, you can create a custom section by simply using this code.

HTML:
<!-- custom code here -->
<div id="davidg" class="itembox">
<div id="davidg-bdrop" class="celldrop"> </div>
<div class="cellbox">
<h6 id="davidg-header" class="itembox" title="Double click to collapse/expand. Click to drag." style="clear:none;" ondblclick="rollbox(this);" class="ie-hover"><div id="davidg-expander" class="box-collapse-control" style="float:right" onClick="rollbox(this);"> </div>My custom section</h6>
<div id="davidg-body">
Let's see what we can put here...
<div class="clearit"> </div>
</div>
</div>
<div id="davidg-adrop" class="celldrop"> </div>
</div>
<!-- end of custom code -->
Known issues with this code as it stands right now:
- The location is not stored like the other feature boxes (as this is not using the APIs that access and use that information)
- You can't add icons for plug-ins to this feature box.

I figure it's a good running start for those that want this functionality.
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
I know this post is super old but it still surprises me that cPanel hasn't made creating groups/icons any easy. You would think there would be some easy way to do this but still have to do is the old way.

I found it a big hassle in maintaining an outside theme and would like to try using the branding editor. Using David's code I inserted it into index.html and that made a new box with the text inside it no problem, but how do I get the icons to go inside that box?
You are correct, this post is "super old."

Here's some updated documentation that makes the process of adding your own icon groups much easier, and compatible with cPanel plugins:

Spotlight On: The cPanel Interface - Icons, Groups and Variables - cPanel Integration