Content Blocks
Content Blocks contain the creative content of each document page. They are HTML files, but they do not include page level layout, or any of the document's structural elements like the title, menu, header, footer or search form. These elements are supplied by the template or DynaDoc. DynaDoc was designed so that the effort of creating documents is focused primarily on the creation of these content blocks, and the order in which they will be displayed. There are two content blocks that can be used on each page. One is used for the primary content of the page, and the second is used for a sidebar.
The primary content block for this page up to this point is shown below.
<h1>Content Blocks</h1>
<p>Content Blocks contain the creative content of each document page. They are HTML files, but they do not include page level layout, or any of the document structural elements like the menu, header or footer. These elements are supplied by the template or DynaDoc. DynaDoc was designed so that the effort of creating documents is focused primarily on the creation of these content blocks, and the order in which they will be displayed. There are two content blocks. One is used for the primary content of the page, and the second is used for a sidebar.<p>
<p>The content block for this page up to this point is shown below.<p>
|
Notice that the contents of the content block are quite simple, yet the page you see displayed has many more elements and features. That is the beauty and power of DynaDoc - to create this entire page, only the above block of HTML had to be written.
Other key points:
- The layout and style of this page can be easily changed by applying a different template.
- The document can be easily restructured and the menu would be regenerated by DynaDoc, so menu and link management is not required.
- Conditional pages and text can be used to create unique versions of this document from the same source.
Content Block Tags
The primary and secondary content blocks allow tags for conditional text and to include other files. The following tag sets are allowed:
Content Block Tag Set |
Description |
<!--v--> <!--/v--> |
Enclosed text will only be included in view version. |
<!--p--> <!--/p--> |
Enclosed text will only be included in print version. |
<!--#--> <!--/#--> |
Enclosed text will only be included if the VALID_TEXT command includes #, where # is 0 - 9. |
<!--x#--> <!--/x#--> |
Enclosed text will be excluded if the VALID_TEXT command includes #, where # is 0 - 9 (note the preceding lower case "x" for exclude). |
<!--i--> includeTarget <!--/i--> |
Include Other Content in place of this tag set. Other content (defined by includeTarget) can be another content file, text substitutions, or the value of a DynaDoc variable. Another content file can be defined explicitly or by using a variable.
If used to include a file, the file name should be included between the tags, and may include a path (relative to DynaDoc location). Included files can be used recursively - any include tags in the included file will be processed. Order of search locations: relative to Dynadoc location, htmPath. An included file can be referenced using a variable name for the filename. To use a variable for the filename the variable name should be preceded by "@@". The variable and filename must be defined as a text substitution using SUB or SUBLIST. DynaDoc will resolve the variable name to the file name using the text substitution and then include that file if it exists.
Text substitution placeholders should be preceded by "$$". For example, $$sub_for_this will be replaced by the definition defined for sub_for_this in the SUB or SUBLIST commands. Placeholders are case sensitive.
If the content is the value of a variable, the variable name should be preceded by "$$". For example, $$product will be replaced with the Product Name (DynaDoc in the case of this document), and $$docType will be replaced with the type of document (Operator's Manual in the case of this document). Variables are case sensitive.
Multiple include tags may be used in one file.
|
<!--i--> defaultText || includeTarget <!--/i--> |
This version of Include Other Content is similar to above, but in this case, default text can be proposed for use if the content to be included is not found. The result will either be the content to be included specified by includeTarget, or the defaultText if includeTarget is not found.
All other aspects of Include Other Content defined above apply.
This can be used to set a default value for most versions of a document, but use a dynamically defined value for specific versions of the document.
|
Including DynaDoc Variables
Variables defined by commands can be found in the Commands table. Other useful variables are defined below:
Variable Name |
Value |
proj |
The project script name |
projDir |
The project folder |
|