Syntax Parameters Example Programs
w3HtmlInsertSection inserts HTML code from the named item into the page being built. Within the template there are three ways to modify the results. These modifications are applied in the following order:
Include files which are inserted into the template as the template is processed.
Begin/End blocks indicating which part of the template to use.
Section names to indicate which subsection of the template to use.
All include files specified in a template file are expanded before any other evaluation takes place. Include files are evaluated depth first and can be nested to an unspecified limit (testing has gone to 15 levels). An include file is added to a template by using the following syntax in the template:
<!--w3Include filename itemname-->
or
<!--w3Include itemname-->
or
<!--w3Include accountname,filename, itemname-->
or
<!--w3Include dos:drive:\directory filename-->
In the second example, the included template is read from the current template source file (usually w3Html. The syntax must be used exactly as shown, with no spaces before or after the dashes "--" in the HTML tag.
If an expansion error occurs, such as the include file cannot be read, or a nesting loop is detected, or the source file does not exist. An error is logged to the w3Logs,flashconnect file and nothing is output.
After all templates are fully expanded, the part of the fully expanded template inside of the of the first BEGIN/END block is used. If there is no BEGIN/END block, the entire template is used. A BEGIN block starts with the text "##BEGIN##" and ends with the text "##END##". For most applications, using Section names is preferred over using BEGIN/END blocks.
Excluded
##BEGIN##
Inserted HTML
##END##
Excluded
You can insert part of a template by naming each logical section of the template. A section is indicated by bracketing it with section markers. There is a section marker at the beginning and end of each section. If the specified section does not exist, nothing is used. If no section name is specified (the section parameter is "") the entire template is used. A section marker pair looks like:
<!--sectionname-->
<!--/sectionname-->
For example, if you use the following call:
call w3HtmlInsertSection("xyz.html","", "first")
... the xyz.html item looks like this:
<!--first-->
Inserted HTML
<!--/first-->
<!--second-->
not inserted
<!--/second-->
Only the text "Inserted HTML" is included.
A template can contain more than one section, however, each section within a template must have a unique name.
Unless debugging is enabled, the last template used is cached. Requests for non-existing templates are logged in the w3Logs,FlashCONNECT file.
call w3HtmlInsertSection (id , sub , section )
|
id |
In |
The item-id of the HTML to insert. |
|
sub |
In |
The substitution matrix. See w3HtmlParse for more information. |
|
section |
In |
The name of the section to insert. |