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.

Custom Display Groups in cPanel

Discussion in 'cPanel Developers' started by RSimoes, Oct 13, 2008.

  1. RSimoes

    RSimoes Member
    PartnerNOC

    Joined:
    Oct 9, 2008
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Austin, TX
    I was interested in placing a custom cPanel plugin in its own x3 display group. Are these display groups hard-coded, or can I add one?
     
  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
    Very long story short, there is no good way to add your own custom display group at this time.

    One method I use essentially forces the group to always default to being at the top or bottom of the page. I just copy the HTML generated by API2 to trigger the appropriate CSS. I paste this code into index.html of my style.

    I can get you a code sample if you desire.
     
  3. RSimoes

    RSimoes Member
    PartnerNOC

    Joined:
    Oct 9, 2008
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Austin, TX
    Thanks for the response, David. What you describe is exactly what I had in mind as a last resort. :)
     
  4. jols

    jols Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,111
    Likes Received:
    2
    Trophy Points:
    38
    Assuming this is still the case. We have found a way to do this, however the title of the custom section disappears with every cPanel update. Thus my question:

    Do you see any harm in doing the following?

    chattr +i /usr/local/cpanel/base/frontend/x3/dynamicui.conf
     
  5. 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 can cause difficult to diagnose issues in the long-term (when one forgets what files were set to +i) and the cPanel update mechanism often ignores +i. I recommend creating a shell script /scripts/preupcp which backs up your dynamicui.conf and a /scripts/postupcp shell script to restore your backup. This way in the future if this causes abnormal behavior, the presence of preupcp and postupcp will remind you about the customization that was done.

    However, once we do support custom sections, I recommend using that support instead. This should only be treated as an interim solution.
     
  6. jols

    jols Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,111
    Likes Received:
    2
    Trophy Points:
    38
    Thanks for the very good advice.

    Any idea about when cPanel will support custom groups? Seems like this has been in discussion for a great long while at this point.
     
  7. cPanelNick

    cPanelNick Administrator
    Staff Member

    Joined:
    Mar 9, 2015
    Messages:
    3,426
    Likes Received:
    2
    Trophy Points:
    38
    cPanel Access Level:
    DataCenter Provider
    Just drop a .conf file in /usr/local/cpanel/base/frontend/x3/dynamicui/

    Add anything you like in the same format as /usr/local/cpanel/base/frontend/x3/dynamicui.conf


    Sample Line

    description=>MyGroup,file=>group_mygroup,group=>mygroup,groupdesc=>MyGroup,grouporder=>20,imgtype=>icon,subtype=>img,height=>32,type=>image,width=>32
     
  8. jols

    jols Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,111
    Likes Received:
    2
    Trophy Points:
    38
    cpanelnick, thanks a ton for this tip!
     
  9. volex

    volex Member
    PartnerNOC

    Joined:
    Feb 5, 2008
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Is there any way I can get the group to appear above the "preferences" group? I tried setting grouporder=>1 and grouporder=>0 to see if this worked, the group still shows up second though after preferences, thanks.
     
  10. 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
    grouporder dictates the default location.

    What you can do is set grouporder to a very negative number (e.g. -99) to ensure this group is always at the top. After you change the file, click "reset box order" located at the bottom of the cPanel interface's homepage, then reload the page in your browser to see your new default.
     
  11. cPanelNick

    cPanelNick Administrator
    Staff Member

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

    Solokron Well-Known Member

    Joined:
    Aug 8, 2003
    Messages:
    849
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Seattle
    cPanel Access Level:
    DataCenter Provider
    Got it working.


     
    #12 Solokron, Jan 3, 2010
    Last edited: Jan 3, 2010
Loading...

Share This Page