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

Guide to cPanel Interface Customization - Apply Styles

Introduction

Note:

Custom styles are only available in the Paper Lantern theme. The Paper Lantern theme is now deprecated and will be removed. For more information, read our cPanel Deprecation Plan documentation.


To display a style for a particular user in the cPanel interface, you must apply that style to the account. Some methods to apply a style also require specific permissions on the server.

For example, to apply a style as the server-wide default cPanel style, you must have root access to the server.

This document describes methods to apply styles via the command line. You can also use WHM's Customization interface (WHM >> Home >> cPanel >> Customization) to upload and apply styles.

After you upload a style that includes custom icons, you must run the /usr/local/cpanel/bin/sprite_generator utility to integrate the new icons.

Apply a style

Styles on cPanel servers exist in two categories:

  • Default style – The style that cPanel accounts default to, if the users have not selected a current style.

    • The root user sets the server's default style.
    • Resellers can set a default style for the accounts that they own.
  • Current style – A style that the cPanel user or reseller has selected to use for an account, instead of the default style.

Apply to the server as the default style

To apply a style as the server's default style, perform the following steps:

  1. Log in to the server via SSH as the root user.
  2. Create the /var/cpanel/customizations/styled directory, if it does not already exist.
  3. Run the following command, where path_to_style represents the absolute path to the style that you wish to apply:

    ln -s path_to_style /var/cpanel/customizations/styled/default_style

For example, to apply the /var/cpanel/customizations/styled/mystyle style, run the following command:

```
ln -s /var/cpanel/customizations/styled/mystyle /var/cpanel/customizations/styled/default_style
```

Apply to a reseller's accounts as the default style

To apply a style to all of a reseller's accounts as the default style, perform the following steps:

  1. Log in to cPanel as the reseller.
  2. Navigate to cPanel's Change Style interface (cPanel >> Home >> Preferences >> Change Style).
  3. Click Set as Default for the desired style.

To apply a style to all of a reseller's accounts as the default style through the command line, perform the following steps:

  1. Log in to the server via SSH as the reseller.
  2. Create the /var/cpanel/reseller/styled directory, if it does not already exist.
  3. Run the following command, where path_to_style represents the absolute path to the style that you wish to apply:

    ln -s path_to_style /var/cpanel/reseller/styled/default_style

    For example, to apply the /var/cpanel/customizations/styled/mystyle style, run the following command:

    ln -s /var/cpanel/customizations/styled/mystyle /var/cpanel/reseller/styled/default_style

Apply to a single user's account as the current style

To apply a style to a specific account through the cPanel interface, perform the following steps:

  1. Log in to cPanel as the desired user.
  2. Navigate to cPanel's Change Style interface (cPanel >> Home >> Preferences >> Change Style).
  3. Click Apply for the desired style.

To apply a style to a specific account through the command line, perform the following steps:

  1. Log in to the server via SSH as the desired user.
  2. Run the following command, where username represents the cPanel account's username, and path_to_style represents the absolute path to the style that you wish to apply:

    ln -s path_to_style /home/username/var/cpanel/styled/current_style

    For example, to apply the /var/cpanel/customizations/styled/mystyle style for the username user, run the following command:

    ln -s /var/cpanel/customizations/styled/mystyle /home/username/var/cpanel/styled/cur

Apply to all accounts as the current style

To apply a style to all of your server's accounts through the command line, perform the following steps:

  1. Log in to the server via SSH as the root user.
  2. Run the following command, where themename represents the desired theme and stylename represents the desired style for that theme:

    /usr/local/cpanel/scripts/modify_accounts --theme=themename --all-users --style=stylename

For example, to apply the /var/cpanel/customizations/styled/mystyle style for the Paper Lantern theme, run the following command:

/usr/local/cpanel/scripts/modify_accounts --theme=paper_lantern --all-users --style=mystyle

For more information, read our The modify_accounts Script documentation.