Some of the procedural information in this section is now outdated. Although most of the details about sections and symbols etc. is still correct, you should obviously use the new HTML Template Editor.
edit Applying templates from the forumYou can download templates from the HFS templates forum or from the HFS Template Gallery. To apply a template, follow these steps:
Test your new HTML template by pressing the "apply" button and reloading the HFS web page into your browser. edit Building your own HTML template1. Open the "Menu" in HFS. 2. Select "Other options" and open "Edit HTML template". 3. Press the "Help" button to list the available symbols for your HTML template. edit How templates workHFS builds HTML pages dynamically by loading pieces of HTML code from a template. A template is text divided into sections. Each section describes a part of the final HTML page which will be served to the requesting browser. The template must provide all sections for correct working of the generated HTML, so a section usually contains HTML code. Since the final HTML page is built dynamically, symbols have to be used to get valid output. Symbols are surrounded by %percent% characters and define the corresponding sections. A section is labelled by using [square brackets]. Symbols will be translated into actual values at run-time. Some symbols return a string for the current variable, while others only get activated if a certain condition is met. Besides symbols, some defined address line operators can also call sections to generate HTML for output. In the main section, which is unlabeled, and in all other sections, symbols can be used to control the HTML output. Some symbols are limited to a specific section. Some symbols will produce the HTML from the corresponding sections, while others just return the corresponding actual string or value. The best way to build a template is to edit an existing template. edit Where is the template storedThe template is stored always "near" the options. If the options are saved in disk (file hfs.ini) then the template is also saved to disk (file named hfs.tpl). You can find these files in the same folder as hfs.exe (the software). More often, both the template and the options are saved in the registry (by default). The template is loaded at HFS startup. If no template is found, then the default one is used. edit Other useful thingsIf you are bustling with template editing, you will be interested in symbols, macros and address operators. edit Sections listSections available in the template:
edit Section aliasingYou can specify 2 or more sections in brackets, and the same content will be assigned to all of them. The syntax is [A = B = C = D] where A, B, C, etc, are sections. This is very useful when you are specifying the content for [file.EXT] sections, like images. [file.jpg = file.jpeg = file.png = file.gif] edit Customizing graph colors and sizeAvailable since build #081. You can customize graph colors inside the template. The graph address is ~img_graph, but you can append to the name several options separated by an x. For example, ~img_graph190x40xx333x000 The full list of options, in order is: width, height, refresh rate, background color, grid color, out bandwidth color, in bandwidth color, text color. You can specify as many options as you want, even none. Current default values for width/height/colors are the same as in HFS window. Colors can be specified in at least two forms: RGB, RRGGBB. Refresh rate doesn't work inside template itself, but only if you access the graph alone, directly in your browser. If not specified, refresh is disabled. edit Embedding pages inside a templateIf you put a whole HTML page under [a_name_you_choose] section, then it will be available at http://YOUR_ADDRESS/~a_name_you_choose edit Unicode supportNormally HFS converts %symbols% to ANSI characters (not unicode). But the default template itself uses unicode UTF-8 encoding, to easily support any character/glyph. HFS will know the template wants UTF-8 by searching for the string =UTF-8 inside the template itself. This is supposed to be part of the string <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> Then, when this is found, HFS will work accordingly. The searching is made in the source of the template, far before any symbol or macro is expanded, so don't try to make this dynamic.
Last modified February 11, 2010 3:23 pm / Content is available under GNU Free Documentation License 1.2. / Skin by Kevin Hughes
![]() |