Development Guides Home >> Guide to cPanel Interface Customization and Branding

Guide to cPanel Interface Customization - Customize Feature Groups

Introduction

You can customize the order and expand/collapse state of the cPanel interface's feature groups for accounts.

Reorder the feature groups

To set the default order of feature groups for new users in the cPanel interface, perform the following steps:

  1. Log in to the server as the root user.
  2. Create the /root/cpanel3-skel/.cpanel/nvdata skeleton directory if it does not exist.
  3. In the /root/cpanel3-skel/.cpanel/nvdata directory, create the xmaingroupsorder file.
  4. In the xmaingroupsorder file, enter a pipe-separated list of feature group names. For example:
    |databases|email|domains|files|metrics|security|software|advanced|preferences|applications

After you make this change, all new cPanel accounts you create will use this group order.

Collapse specific feature groups by default

To collapse a specific list of feature groups to collapse by default in the cPanel interface, perform the following steps:

  1. Log in to the server as the root user.
  2. Create the /root/cpanel3-skel/.cpanel/nvdata skeleton directory if it does not exist.
  3. In the /root/cpanel3-skel/.cpanel/nvdata directory, create the xmainrollstatus file.
  4. In the xmainrollstatus file, enter a pipe-separated list of the group names and a Boolean false value ( 0 ) for each feature group. For example, to collapse only the Databases , Domains , Email , and Metrics feature groups by default, use the following format:
    |databases=0|domains=0|email=0|metrics=0

The list of feature groups must begin with a pipe character.

After you make this change, all new cPanel accounts you create will collapse the specified feature groups by default.

Apply your changes to existing users

You must run the following commands as the root user, or use the sudo su - command to promote the user to root to run the command.

To apply your customizations to existing users, use the Personalization::set function.

Reorder the feature groups

To reorder the feature groups, run the following command, where username is the account's name:

echo '{"personalization": {"xmaingroupsorder":"databases|email|domains|files|metrics|security|software|advanced|preferences|applications"}}' | uapi --user=username --input=json --output=jsonpretty Personalization set

The API response will resemble the following:

{
    "apiversion": 3,
    "module": "Personalization",
    "func": "set",
    "result": {
        "warnings": null,
        "errors": null,
        "data": {
            "personalization": {
                "xmaingroupsorder": {
                    "value": "databases|email|domains|files|metrics|security|software|advanced|preferences|applications",
                    "success": 1,
                    "reason": "OK"
                }
            }
        },
        "metadata": {},
        "status": 1,
        "messages": null
    }
}

Collapse specific feature groups by default

To collapse specific feature groups, run the following command, where username is account's name:

echo '{"personalization": {"xmainrollstatus":"|databases=0|domains=0|email=0|metrics=0"}}' | uapi --user=username --input=json --output=jsonpretty Personalization set

The API response will resemble the following:

{
    "apiversion": 3,
    "module": "Personalization",
    "func": "set",
    "result": {
        "warnings": null,
        "data": {
            "personalization": {
                "xmainrollstatus": {
                    "reason": "OK",
                    "value": "|databases=0|domains=0|email=0|metrics=0",
                    "success": 1
                }
            }
        },
        "metadata": {},
        "errors": null,
        "messages": null,
        "status": 1
    }
}