PanuWorld Layout Manager

command reference

Files

File name Description
LayoutManager.exe  Executable of the PanuWorld Layout Manager. Drop files/folders to process on its icon.
_layout.html Template file containing the common sections of the web pages and the commands setting the default values for variables.
_random.txt File containing list of items (one per line) that are inserted with $EVAL RANDOM. Empty lines and lines beginning with # (hash) character are ignored. Not needed if $EVAL RANDOM is not used.

All these files must be in a directory containing the root folder of the local copy of the web site.

File extensions supported

When a folder a processed by the PanuWorld Layout Manager, the files with the following extensions are processed only: *.html, *.htm, *.php.

If a file (not a folder) with any extension is specified, it is always processed. Any files named _layout.html cannot be processed to avoid accidentally messing up the template file.

template/document sections

The template file _layout.html and all web page documents are divided in three sections:

Template file (_layout.html) Document files (web pages)
beginning common section (TC)
<!--$BEGIN BODY-->
template content section (TB)
<!--$END BODY-->
ending common section (TC)
(evaluated beginning common section)
<!--$BEGIN BODY-->
document content section (DB)
<!--$END BODY-->
(evaluated ending common section)

Layout Manager commands are evaluated in the following order (separately for each processed file):

  1. Commands in the template content section (set common default values for variables here).
  2. Commands in the document content section (set page-specific values for variables here).
  3. Commands in the template common sections (variables are only evaluated, no variables can be set/modified anymore).

Only variable setting commands are evaluated in the template content section. Everything else between the <!--$BEGIN BODY--> and <!--$END BODY--> tags is discarded during processing.

Similarly, all existing content outside <!--$BEGIN BODY--> and <!--$END BODY--> tags in the processed web page is discarded. Make sure that all page-specific content is between these tags.

commands

Usage*
Command (all in uppercase) Parameters (all in uppercase) TC TB DB Description Notes
$BEGIN BODY (none) X X Marks the beginning of the section where the actual content is inserted from the HTML file. In a processed web page file marks the beginning of the page-specific content.
$END BODY (none) X X Marks the end of the section where the actual content is inserted from the HTML file. In a processed web page file marks the end of the page-specific content.
$EVAL name name = variable name X Replaced with the value of the variable. Replaced with character 2 (two) if variable is not set.
$EVAL RANDOM (none) X Replaced with randomly selected row from the _random.txt file. Empty lines and lines starting with # (hash) are ignored in _random.txt.
$IF name name = variable name X Rest of the row is included in the processed file only if the variable has been set.
$IFNOT name name = variable name X Rest of the row is included in the processed file only if the variable has not been set.
$SET name value name = variable name
value = value to be set (rest of the line, may contain spaces)
X X Sets a value to the variable. The value may be empty (i.e. missing from the command).
$BEGIN name
value
$END name
name = variable name
value = value to be set (lines between the matching $BEGIN and $END)
X X Sets a value to the variable, used especially for multi-line values. Also the characters following the $BEGIN command and before the $END command on the same row are also included.
$FOLDER name name = variable/subdirectory name X (X) Sets the variable to character 1 (one) if there is a matching directory name in the path of the processed file. The directory name comparison is case-insensitive.
$OPTION name name = variable name (X) X Sets the variable to character 1 (one). Same as $SET name 1.

 * Allowed usage location for the command. Legend: TC = common section of the template file _layout.html, TB = content section of the template file, DB = content section of the web page to be processed, X = allowed, (X) = allowed but unlikely.

Command tags and parameters shall be separated from each other with single space characters.

variable names

Varible names must consist of 1...16 UPPERCASE letters (A...Z only). The following variable names are not allowed: BODY, RANDOM.

These predefined variables are automatically set when starting to process a HTML file:

Variable name Description Example value
ROOT Relative path from the web page to the root level of the site ../../../
GENERATOR The current version of the Layout Manager PanuWorld Layout Manager 2; https://panuworld.net/

Predefined variables are included in the maximum number of variables (16). Also the predefined variables can be overridden by setting them to new values.

More information

For installation instructions and an introduction to the PanuWorld Layout Manager, see the PanuWorld Layout Manager manual. Example template file and the download link can be found on the PanuWorld Layout Manager home page.

 
To see PanuWorld's finest appearance, update your web browser!