Skip to main content

File structure

Template structure​

The basic structure of the tempalte is the following:

|-- scripts
|-- editor
|-- scripts.js - optional
|-- templateItems
|-- templates
|-- FullMasterPage.html
|-- settings.json - optional

You can have your own structure, with your own folders, it won't affect the template. The only exception are the folders templateItems and templates. These folders are scanned and converted into code and dynamically created for you to browse.

To start a new template you can add your current source files and zip the root folder:

Include an html file with the name FullMasterPage.html in the root folder with the minimal code (see Master Page for more):

<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
{container:Menu /}

{container:Content /}

{container:Footer /}
</body>
</html>

To make sure we have the correct server path, we try to correct the paths inside the files. Files inside fonts and images are ignored. Please make sure you are have the files in the correct folders.

The file scripts/editor/scripts.js is used as a helper to better render the template in website editor used by the user. This file is optional, the app will continue to work, however if the tempalte contains third party components that need to be initialized, you might want to trigger them using the hooks setup in this file. See Editor script.

The file FullMasterPage.html will be located in the root of the template, see Master Page.

The file settings.json will be located in the root of the template, this file is optional, see Settings for details.

Template thumbnail and preview image​

Website thumbnail should be in the root of images folder as images/template_thumbnail_S.jpg and images/template_thumbnail_L.jpg, where the S is the low resolution version of the thumbnail and L is the high resolution.

Website preview image should be in the root of images folder as images/template_preview.jpg, this will be used in lists for users to see a preview of this template. It is recommended that this image be a preview of any premade website.

Referencing files in your code​

When referencing files inside the templates, you must make sure that the paths are correct so that the template engine can read it.
We try to append the template storage path to your files.

e.g.: ~root/images/path/to/image.jpg will be transformed to
/the_path_to_container_folder/images/path/to/image.jpg

Having your paths starting as root/images/path/to/image.jpg will not be transformed.

{:ImageL defaultValue='~root/images/path/to/image.jpg'}

OR

{object:Example 
name="Example"
thumbnail="~root/images/path/to/image.jpg"}

...
...

{/object:Example}

OR

{object:Example 
name="Example"
thumbnail="~root/images/path/to/image.jpg"}

<img src="~root/images/test.jpg" alt="test" width="500" height="600">

{/object:Example}

NOTE​

Referencing the files using ~root can be used only in object:ObjectName items and Master pages, this CANNOT be used in css or javascript or any other file. To reference resources in other items, one should use relative paths.