Compiling Templates With Client-Side Form Validation

 

Related Docs:   Understanding Templates

There are two types of templates that are responsible for generating Control Panel web content: *.html.in templates with client-side form validation that require compilation before modifications in them would take effect, and *.html templates that provide server-side form validation and don't need to be recompiled after their modification.

This document provides step-by-step instructions on how to compile control panel templates with the client-side validation of HTML form input fields.

  1. Log into the control panel server as cpanel user:

    # su - cpanel

    To implement customization correctly, all template files and directories should have the cpanel:cpanel ownership.

  2. Check settings in /hsphere/local/home/cpanel/shiva/psoft_config/hsphere.properties:

    1) Check the TEMPLATE_PATH parameter. It should point to the default template directory. Default setting is:

    TEMPLATE_PATH = /hsphere/local/home/cpanel/shiva/shiva-templates/

    2) Uncomment the USER_TEMPLATE_PATH parameter and set it to your custom templates directory, e.g.,:

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

    3) Check the JS (JavaScripts) and IMAGES parameters:

    JS =
    IMAGES =

    By default, JS and IMAGES are left blank. It means that javascripts and images are placed inside each design directory. You don't need to change these parameters if you have default system settings.

  3. Go to the default templates directory (DocumentRoot, /hsphere/local/home/cpanel/shiva/shiva-templates by default). Check parameters in the configure file:

    (1) SHIVA_ROOT - H-Sphere Control Panel's root directory (/hsphere/local/home/cpanel/shiva by default)
    (2) HSPHERE_PROPERTIES - path to the hsphere.properties file.

  4. Run ./configure in the templates directory. This will create Makefiles for all of designs.

    Warning: Running ./configure clean would remove ALL the compiled templates in the nested directories and delete ALL Makefiles created by the previous configure execution! After that, your control panel interface would not show up correctly!

  5. To compile all modified templates, run make or make all in your default templates directory (gmake for FreeBSD). If you need just to modify one template, run make from the directory where this template is located.

    Warning: Running the make clean command from a certain template directory would clear all the compiled template files (*.html) in the nested directories! After that, your control panel interface would not show up correctly!


Related Docs:   Understanding Templates







Home   Products   Services   News
© Copyright. . PSOFT. All Rights Reserved. Terms | Site Map