Parallels H-Sphere Documentation Customization Guide


Menu Design Customization


Related Docs:   Menu Customization Template Customization Skin And Icon Set Customization H-Sphere Packages

Last modified: 28 Dec 2007


WARNING: This documentation covers Parallels H-Sphere versions up to 3.1. For the latest up-to-date Parallels H-Sphere documentation, please proceed to the official Parallels site.

This document explains how to change the appearance of the navigation menu in the H-Sphere control panel. You are expected to be familiar with the FreeMarker technology and with H-Sphere templates.

The template to be customized is ~cpanel/shiva/shiva-templates/common/menu.fn. The instruciton below is the regular way of template customization. This customization can be also performed by means of H-Sphere packages explained in Developer Guide.

  1. Login as cpanel, under root:

    su -
    su -l cpanel

  2. Create the ~cpanel/shiva/custom directory if it doesn't exist yet.

  3. Inside the custom/ directory, create the following directories if they aren't there:

    • templates/
    • images/
    • bundles/

    Note: If the images/ directory is created, there must be a symlink to this directory from the Apache document root (which is the default template directory ~cpanel/shiva/shiva-templates); if not, users should place their images into the IMAGES directory.

  4. Put your images into the images/ directory and your interface text files (bundles) into the bundles/ directory.

  5. In the templates/ directory, create the common/ directory if it doesn't exist and copy the menu.fn file from the shiva-templates/common/ directory into that directory.

  6. Make changes in custom menu.fn. The following Freemarker functions are used in menu.fn to draw the navigation menu:

    - <function draw_menu(activeItem)>;
    - <function draw_sub(item, level)>;
    - <function draw_item(item, level)>;
    - <function draw_blank_menu()>.

    These functions draw different elements of the control panel menu. If you change them please note that the HTML tags you add must be well ordered and valid. For example, you have to make sure that the number of columns in the menu table, which is set in draw_menu, is the same in all these functions.

    (a) The draw_menu function calls the other mentioned functions to draw the menu and also defines the menu table as follows:


    (b) The draw_sub function draws the menu item which is the node for the submenu (group name):

    The menu_was_drawn variable is used to figure out how to show the next item.

    (c) The draw_item function draws the menu item which does not have a submenu. It may be a second-level item:

    Or, it could be even a first-level item that does not fall into any menu group:

    (d) The draw_sub_items function checks the type of the menu item and calls functions (b) or (c):

    If you don't want to use a standard H-Sphere image, change the following calls:

    <call draw_image("standard-image-mnemonic-id")>


    <IMG SRC="path_to_your_image/replacing_image" WIDTH="xx" HEIGHT="yy"></TD>

    where path_to_your_image could be set either as the /IMAGES URL relative to the Apache document root, or as any absolute URL to your image, like

  7. Open the ~cpanel/shiva/psoft_config/ file, uncomment and correct (if necessary) the following lines:

    USER_TEMPLATE_PATH = /hsphere/local/home/cpanel/shiva/custom/templates/

    See more about template customization and menu.xml customization.

    Note: Don't initialize the variables you are not using!

  8. Login as root and restart H-Sphere.

Related Docs:   Menu Customization Template Customization Skin And Icon Set Customization H-Sphere Packages

© Copyright 2018. Parallels Holdings. All rights reserved.