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.

Add a Menu

Discussion in 'User Experience' started by Sash, Aug 14, 2008.

  1. Sash

    Sash Well-Known Member

    Joined:
    Feb 18, 2003
    Messages:
    252
    Likes Received:
    0
    Trophy Points:
    16
    Does anyone know how to add a menu to the x3 theme in cpanel? The Mail, Security, File, Domains....etc menus.

    Thanks,
    Mike
     
  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
    There's no official support for this at this time. However, there is a kludge that would work in the meantime.

    By using the Branding Editor, you can edit index.html (the entry page that has those menus/groups) and add your own section either above or below all of the pre-existing sections. The following code can be inserted at the beginning of the boxes "div" and before <cp Branding:applist() > to place your custom group above all other groups:

    HTML:
    <div id="myGroup" class="itembox">
      <div id="myGroup-bdrop" class="celldrop"> </div>
      <div class="cellbox">
      			
                <h6   id="myGroup-header" title="Double click to collapse/expand.  Click to drag." style="clear:none;" ondblclick="rollbox(this);" class="ie-hover"><div id="myGroup-expander"  class="box-collapse-control" style="float:right" onClick="rollbox(this);"> </div>myGroup Section Title</h6>
                <div id="myGroup-body">
                    HTML to go in this custom section.
           <div class="clearit"> </div>
       </div>
      </div>
      <div id="myGroup-adrop" class="celldrop"> </div>
    </div>
    You can place any HTML or API1/API2 code inside the body of the section.

    Note, this is a kludge since if the user drags the box, there is no method of saving that placement at this time so the box will always appear at the top (or at the bottom if you place it before the boxes "/div").
     
  3. Sash

    Sash Well-Known Member

    Joined:
    Feb 18, 2003
    Messages:
    252
    Likes Received:
    0
    Trophy Points:
    16
    Thank you...

    I was able to put the custom box at the top. I'd like to put the box at the bottom, but I'm having trouble.

    Can you tell me what line the boxes "/div" code is on?

    Thanks,
    Mike
     
    #3 Sash, Aug 16, 2008
    Last edited: Aug 17, 2008
  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
    Given customizations you may have performed, I wouldn't have an exact line number for you. However, in the default version of the file, the first </div> after the API call that displays the individual groups of icons (starts with <?cp Branding::applist and ends with ?>) is the closing tag for the boxes div.

    Therefore, to always place your box at the bottom, simply place it between the the ?> and </div>.
     
  5. Sash

    Sash Well-Known Member

    Joined:
    Feb 18, 2003
    Messages:
    252
    Likes Received:
    0
    Trophy Points:
    16
    David,

    I still seem to be having trouble.

    In a default version of the index file, I placed the code on line 226, right after <?cp Branding::applist([div id="%" class="itembox"] and before [div id="%-bdrop" class="celldrop"] [/div], although I receive a bunch of errors when I tried to load cpanel.

    Can you confirm the line number where the custom code should be placed?

    Thanks,
    Mike
     
  6. 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 don't place the HTML/CSS code inside the API2 code. You put it after the API2 code (after ?>) not inside the API2 code (indicated by the provided code using [div] instead of <div>).

    On the default version of the file (with no modifications), this code should be placed on line 245.

    Note, this code is subject to change to this exact line number may change in the future.
     
  7. Sash

    Sash Well-Known Member

    Joined:
    Feb 18, 2003
    Messages:
    252
    Likes Received:
    0
    Trophy Points:
    16
    Thanks.....that worked.

    Mike
     
Loading...

Share This Page