The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to create custom groups/sections in cPanel?

Discussion in 'General Discussion' started by Funkadelic, Mar 5, 2008.

  1. Funkadelic

    Funkadelic Well-Known Member

    Joined:
    Feb 10, 2006
    Messages:
    73
    Likes Received:
    0
    Trophy Points:
    6
    Trying to find out how to create my own groups/sections, like the Preferences, Mail etc.. groups that have the icons in them.
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    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.
     
  3. Funkadelic

    Funkadelic Well-Known Member

    Joined:
    Feb 10, 2006
    Messages:
    73
    Likes Received:
    0
    Trophy Points:
    6
    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.
     
  4. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    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.
     
  5. Funkadelic

    Funkadelic Well-Known Member

    Joined:
    Feb 10, 2006
    Messages:
    73
    Likes Received:
    0
    Trophy Points:
    6
    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?
     
    #5 Funkadelic, Mar 6, 2008
    Last edited: Mar 6, 2008
  6. Funkadelic

    Funkadelic Well-Known Member

    Joined:
    Feb 10, 2006
    Messages:
    73
    Likes Received:
    0
    Trophy Points:
    6
    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.
     
    #6 Funkadelic, Mar 6, 2008
    Last edited: Mar 6, 2008
  7. s.a.

    s.a. Active Member
    PartnerNOC

    Joined:
    Aug 16, 2007
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Toronto, Canada
    Any hints on where to start digging? Is display groups list stored somewhere in theme files? Can't seem to find it.
     
  8. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    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.
     
  9. s.a.

    s.a. Active Member
    PartnerNOC

    Joined:
    Aug 16, 2007
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Toronto, Canada
    Awesome! This will work even better than creating a custom theme - no worries if some theme need to be updated.

    Thanks David!
     
  10. Funkadelic

    Funkadelic Well-Known Member

    Joined:
    Feb 10, 2006
    Messages:
    73
    Likes Received:
    0
    Trophy Points:
    6
  11. s.a.

    s.a. Active Member
    PartnerNOC

    Joined:
    Aug 16, 2007
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    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!). :)
     
  12. s.a.

    s.a. Active Member
    PartnerNOC

    Joined:
    Aug 16, 2007
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Toronto, Canada
  13. Funkadelic

    Funkadelic Well-Known Member

    Joined:
    Feb 10, 2006
    Messages:
    73
    Likes Received:
    0
    Trophy Points:
    6
    I got it...

    1. Edit Attic/english.orig
    Insert the name of the group
    example:

    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:
    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:
    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'.
     
  14. handsonhosting

    handsonhosting Well-Known Member

    Joined:
    Feb 17, 2002
    Messages:
    151
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Omaha, NE
    cPanel Access Level:
    Root Administrator
    tried, tested and works like a charm.

    Thanks for adding the extra info that cPanel seemed to leave out of their install instructions page :)
     
  15. cPanelNick

    cPanelNick Administrator
    Staff Member

    Joined:
    Mar 9, 2015
    Messages:
    3,426
    Likes Received:
    2
    Trophy Points:
    38
    cPanel Access Level:
    DataCenter Provider
  16. Funkadelic

    Funkadelic Well-Known Member

    Joined:
    Feb 10, 2006
    Messages:
    73
    Likes Received:
    0
    Trophy Points:
    6
    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?

     
  17. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    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
     
Loading...

Share This Page