Compiling Template

To be installed and operated in Sitebuilder, created template source files must be compiled into a template pack (the package that comprises one or more templates). This is an .msi file for Windows OS and .bin file for Linux/Unix OS.

Templates can be compiled only in MS Windows. Linux/Unix compiler will be available in next versions of the Sitebuilder SDK.

Prior to launching the compilation process, make sure that:

Use the following procedure to compile a template:

  1. Anywhere on your hard drive, create a new compile.sbtp file containing the following lines:

    <?xml version="1.0" encoding="utf-8"?>

    <templatePack name="Sample pack" type="Windows">

    <directory path="swsoft-example-01" />

    </templatePack>

  2. Substitute values of the following arguments with your own.

    TemplatePack element.

    name. (optional) Name of a template pack.

    type. Type of operational system, for which the template is compiled. Values: Windows, Unix.

    Directory element.

    path. Path to the directory where template source code is located. The path can be absolute or relative (to the directory where compile.sbtp file is located). Example: D:\Templates\my-template-01.

    Note: Use multiple directory elements to create a template pack.

  3. Double click the compile.sbtp file, or right click the file and choose "Compile as Sitebuilder template" option.

A window displaying the results of the compilation process opens.

The compiled template pack will look as follows: [name of the .sbtp file].msi or [name of the .sbtp file].bin depending on a template type.

Note: You can change name of .sbtp file. For instance, instead of compile.sbtp you can use sample.sbtp.

Remarks (Plesk Sitebuilder for Windows)

When you compile template source code to a .msi file for the first time, content of the .sbtp file is affected. It is true even if the attempt to compile the source code has failed. The following arguments are added automatically to the templatePack element:

version. Stores number of times a template was recompiled (starting from 1).

uid. Identifier of a template pack. The argument value is unaffected on recompilation.

Note: It is not recommended to add or edit the version or uid values without necessity.

Note: After each successful compilation of a given source code, the version value is automatically increased by 1.