Contents

Create a new template

Create simple template

Create multi page template

Localization

How to

Keywords

Create a new template

In order to create a new template you need to have at least one html page with finished layout. You need to make folder named with your new template name in templates folder:

[Program folder]\Templates\New template

This folder should have two subfolders

[Program folder]\Templates\New template\English

[Program folder]\Templates\New template\Files

Usually you need only these two folders even for different locales. See localization part for additional information about language folders.

You should place your html file into the ‘English’ folder. All other files like css files or image files should go into the ‘Files’ folder. You can create simple or multi page template. Please read corresponding parts below.

Create simple template

The ‘Simple’ and ‘Spring’ are simple template examples. You need to define one html file that will have all sections in it in the ‘English’ folder. Let us look at index.htm file of the ‘Simple’ template. This file builds contents section at the top of the page:

In order to do this the following code is used (see the file index.htm of the ‘Simple’ template):

1. <br>

2. <font size=12 style=bold>S_CONTENTS</font>

3. <br>

4. [RepeatCategoryRecurring]

5. <dl>

6. <dt><a href=#_Category[CategoryId]>[CategoryName]</a><br><dd>[CategoryComment]

7. [SubCategory]

8. </dl>

9. [/RepeatCategoryRecurring]

The line 2 has the language keyword S_CONTENTS that will be expanded as ‘Contents’ for the English language. The block [RepeatCategoryRecurring] on lines 4 – 9 defines contents section. This block iterates list of all categories and subcategories. For example, if there are three main categories and last category has two sub-categories the lines 5-8 will be expanded five times. While expanding of these line generator will create category href link, category label, and category comment based on [CategoryId], [CategoryName], and [CategoryComment] keywords.

[SubCategory] keyword on line 7 will expand subcategories recursively.

This code will build the following section:

The notes section goes after contents:

Here is the code that builds notes:

1. [RepeatCategoryRecurring]

2. <br>

3. <a name=_Category[CategoryId]>

4. <br>

5. <font size=16 style=bold>[CategoryName]</font>

6. <br>

7. </a>

8. &nbsp;[CategoryComment]

9. <br>

10. <br>

11. [RepeatNote]

12. <table border = 0 width = 98% cellspacing=0 cellpadding=0>

13. <tr bgcolor = #D3D3D3>

14. <td colspan=3>

15. &nbsp [NoteDate] <br>

16. &nbsp [CategoryName]

17. </td>

18. </tr>

19. <tr valign = top>

20. <td width = 2%>

21. &nbsp;

22. </td>

23. <td align = left>

24. [NotePhoto]

25. [NoteVideo]

26. </td>

27. <td align = left>

28. <table width=500px></table>

29. [Note]

30. </td>

31. </tr>

32. </table>

33. <br>

34. [/RepeatNote]

35. [SubCategory]

36. [/RepeatCategoryRecurring]

TODO

Create multi page template

The ‘Leaves’, ‘Sinorca’, and ‘AktiBlue’ are multi page template examples.

todo

Localization

There are two solutions already existing for providing localization.

First solution works with special keywords with prefix ‘_S’. All predefined templates use this solution. These templates represent text strings as keywords that are expanding while web page generation into corresponding text depending on selected language. For instance, home link has keyword S_HOME in all template files. This keyword will transform into ‘Home’ text string after the web page generation. Program language files have definitions for all of these keywords. Language files have the following location

[Program folder]\ Languages

When web pages in some language have completely different layout you can use the second solution. In this situation, you need to create your language name folder in your template folder:

[Program folder]\Templates\New template\Your language

You should copy to this folder all files from English folder:

[Program folder]\Templates\New template\English

After this, you need to adjust html template files to your language.

In most situations, the first solution is enough and you need not to create additional language folders for templates.

How to

Below you can find several examples of some additional things that you can use in web templates.

Create menu

The ‘AktiBlue’ template has menu with drop down items and you can use it as an example.

Todo 20070403

Display list of child categories of the selected category

In order to show how display list of child categories we will use ‘Leaves’ template.

Note the ‘Sub Categories:’ part at the bottom of this page. This list has been created because of the following code in the file page.htm of the ‘Leaves’ template:

1. [IncludeWhenExists]

2. <h2>S_SUB_CATEGORIES:</h2>

3. <ul>

4. [RepeatSubCategory]

5. <li><a href="[MakePageForCategory(page.htm)]">&raquo; [CategoryName]</a></li>

6. [/RepeatSubCategory]

7. </ul>

8. [/IncludeWhenExists]

[IncludeWhenExists] block (line 1 and line 8) is inserted into the web page only when we have some subcategories of the selected category. S_SUB_CATEGORIES language keyword will be expanded as ‘Sub Categories:’ text if the English language has been selected. The [RepeatSubCategory] block (line 4 and line 6) iterates list of sub categories for the current category. For example, if there are three sub-categories, the line 5 will be expanded three times. While expanding of the line 5 generator places sub-category name instead the [CategoryName] keyword and creates web page for this category if this page is not already exists.

Keywords

RepeatCategoryRecurring

Description

SubCategory

description

CategoryComment

description

MakeMapPage

description

LinkPage

description

MakePage

description

ChartWidth

description

ChartHeight

description

MakePageForArchive

description

MakePageForCategory

description

GetCategoryNo

description

GetNumberOfSubCategories

description

RepeatCategoryId

description

RepeatRecent

description

RepeatSubCategory

description

Title

description

Comment

description

TemplateName

description

TemplateAuthor

description

TemplateFiles

description

TemplateScripts

description

SmallPicture

description

NotePhoto

description

NoteVideo

description

RepeatCategory

description

IncludeWhenExists

description

RepeatArchive

description

RepeatCategoryTop

description

RepeatCategory2

description

RepeatCategory3

description

CategoryName

description

CategoryId

description

RepeatNote

description

Note

description

NoteDate

description

NoteAgeComplete

description

ArchiveDate