Information Center

Using Custom HTML Templates

By default, the Deployment Wizard generates HTML using a basic template installed with the Host On-Demand product. If you wish to modify the appearance of your Web pages, you can provide an alternate template to be used by the Deployment Wizard or modify the default template.

The default template that the Deployment Wizard uses is called Wizard.html. If the Deployment Wizard was installed as part of the Host On-Demand installation, this file resides in the Host On-Demand publish directory C:\Program Files\IBM\HostOnDemand\HOD. If you installed the Deployment Wizard separately, the default location of thie file is C:\Program Files\IBM\Deployment Wizard. It contains fundamental tags for HTML formatting, a few markers for Host On-Demand use, and some appearance-related information, such as banner and background specifications.

As long as the HTML formatting and the Host On-Demand markers in the template are not modified, the template can be customized in any way. For example, it can be updated to include a different banner, background, new images, new text, forms, or JavaScript. These new features will then be added to any HTML code that the Deployment Wizard generates with that template.

You can either modify the default Wizard.html template and have the changes apply to each Deployment Wizard page created or edited, or you can create another template and selectively apply it to different Deployment Wizard pages.

Below is a set of specific steps to create and apply custom templates:

Creating a custom HTML template

  1. To modify the default template, Wizard.html, first make a backup copy of the file (for example, Wizard.htmlbak). Otherwise, create a copy of Wizard.html, and edit the copy.
  2. Modify the template in a UTF-8 compatible HTML editor to include customizations, such as different images and text. When editing the file, do not erase or modify the Host On-Demand marker statements: <!--SUMMARY--><!--SCRIPTS--><!--APPLET--><!--STARTAPPLETPARMS--><!--ENDAPPLETPARMS--> Host On-Demand uses these statements to denote where to write various output information.

    The tags STARTAPPLETPARMS and ENDAPPLETPARMS allow HTML parameters to be added to the template. All of the definitions between these two tags will be placed into the Host On-Demand applet section of the generated HTML.

    A sample of the default Wizard.html template is shown below.

  3. Save the file as a Web page with UTF-8 character encoding.

    Sample default Wizard.html template:

    <!doctype html public "-//W3C//DTD HTML 3.2 Final//EN">
    <HTML>
    <HEAD>
    <meta HTTP-EQUIV="Content-Type" content="text/html; charset=UTF-8">
    <!-- SUMMARY -->
    </HEAD>
    
    <BODY BACKGROUND="hodbkgnd.gif">
    <CENTER>
    <IMG src="hodlogo.gif" ALT="hodlogo.gif">
    <P>
    
    <!-- STARTAPPLETPARMS -->
    <!-- ENDAPPLETPARMS -->
    
    <!-- SCRIPTS -->
    <!-- APPLET -->
    
    </CENTER>
    </BODY>
    </HTML>
    
Because the Host On-Demand cached client support uses a window onLoad event handler, you cannot use an onLoad event handler in the </BODY> tag. When both are present, it causes problems in the browsers. For download clients, the window onLoad event handler is not used; therefore, an onLoad event handler in the </BODY> tag can be used. Another window onLoad event handler can be used in all cases.

Applying the custom HTML template

If you modified the file Wizard.html, be sure that the file name is still named Wizard.html. This file will be applied to all Deployment Wizard pages created or edited (without having to specify a template).

If you want to apply a different custom template to a specific page that the Deployment Wizard generates, complete the following steps:

  1. Open the Deployment Wizard and either select an existing Web page or choose to create a new Web page.
  2. Go to the Additional Options window of the Deployment Wizard and click Advanced Options.
  3. On the Advanced Options window, click HTML templates.
  4. In the HTML Template field, either type the fully-qualified name of the new template or click Browse to find the template.
  5. Once you have selected the template, click OK to close the Advanced Options window.
  6. Save the Web page and close the Deployment Wizard. The Deployment Wizard will remember the template for this Web page and will use it for all subsequent updates.

Subsequent updates to your custom template

If you update the template after creating the HTML file with the Deployment Wizard, you will have to regenerate the HTML code in order to pick up the changed template. This template is only used when you generate the HTML code. To regenerate the file, open it in the Deployment Wizard, go to the last window, and click Create File(s).