Home
Download your own copy of Doc To HTML Converter today!Prev Page Prev Page
Introduction
Using DocToHtml
Getting Started
Conversion Options Dialog
General
Output Filenames
Template Data Editor
Images
Meta Tags
CSS
Advanced
JavaScript
HTML Code
Font Attr
Paragraph Attr
List Attr
Table Attr
Text Boxes
Body & Footer
Footnotes & Endnotes Options
HTML Template
XML & Charset & PG
Browsers
Search & Replace
Batch
Filemasks
Progress Form
Batch Converter
Main Window
Settings Dialog
General
Memory
Timeouts
Command Line Support
Search & Replace Dialog
Installation Issues
Uninstallation Issues
Crash Recovery
Support for 64-Bit MS Word
Troubleshooting
Common Issues
Deep Troubleshooting
Registration Benefits
How to Buy
Support & Feedback
FAQ
How to Speed up the Conversion
Unsupported Formatting
License Agreement
Privacy Policy
Change Log
Credits
Other Products

HTML Template Tab


HTML Template Tab of DocToHtml Converter Options Dialog

This Tab lets you insert any custom HTML code into the resulting document.

Output only HTML inside BODY section—if this option is turned on, DocToHtml will write only normal content enclosed in the <BODY> tags to the output file. Use this option when you need only HTML content, without the HEAD section, for further integration into your CMS or website. You can insert any HTML code before that content (after the <BODY> start tag) or after it (before the </BODY> closing tag). Note that these two text fields will not be disabled if you turn this option on.

Template Location—this drop-down list lets you select the location for inserting your edited template.

Active—this option determines whether the currently selected template will be used.

Expressions—this option controls the evaluation of expression and conditional parsing of the template text.

Report all errors—this option toggles the extended error reporting mode. Use it when you want to make sure that your template is parsed correctly, with all expressions and conditional statements. This setting also affects the parsing and substitution of variables in filenames.

In the text fragments to be inserted, you can use any HTML code and any Unicode characters. However, please note that DocToHtml will not verify the validity of that HTML code, and that certain characters illegal in HTML (<, >, &, and ") will not be converted into their numeric or symbolic entities, so it is up to you to provide a valid markup. Unicode characters that cannot be represented in the current output encoding will be converted into their numeric Unicode entities, as defined in the HTML 4.01 Specification.

Expressions

When this option is enabled, you can use variables, which will be substituted with their actual values when the template is parsed. The variable declaration syntax is %VAR_NAME% (that is, a variable name from the first column of the table below, enclosed in percent signs). To use the percent sign as a literal within the template text, just double it. Supported variable names are given in the table below. N designates the current part number for multi-part output. The minus sign means that the constant is not defined for this part.
VariableSingle part1st page2nd pageMiddle pageLast but oneLast page
INPUT_FILENAMEFilename of the original MS Word document
META_TITLEPage Title
META_BASEHREFBase address
META_AUTHORBase address
META_DESCRIPTIONMeta description
META_KEYWRODSKeywords
FILENAMEPage filename
PART_COUNTTotal number of parts in the output
VariableSingle part1st page2nd pageMiddle pageLast but oneLast page
IS_SINGLE_PART1-
IS_MULTIPLE_PARTS-1
LAST_PART_LINK-Filename of the last part
FIRST_PART_LINK-Filename of the first part
NEXT_PART_LINK-Filename of the next part-
PREVIOUS_PART_LINK--Filename of the previous part
IS_ONLY_ONE_PART-1 if (Total number of parts in the output = 1), otherwise not defined
VariableSingle part1st page2nd pageMiddle pageLast but oneLast page
IS_FIRST_PART-1----
IS_SECOND_PART--1---
IS_PENULTIMATE_PART----1-
IS_LAST_PART-----1
IS_MIDDLE_PART--111-
PART_NUMBER-Current part number
OUTLINE--List number of the first paragraph of a given part. For example, 1.1, 1.2.3, and so on. For the first part, this variable is always an empty string.

Conditional statements

Conditional statement is of the form:
(%IFDEF(<var-name>)%|%IFNDEF(<var-name>)%) <text> {%ELSEIF(<var-name>)% <text>} [%ELSE% <text>] %ENDIF%
Here <var-name> is the name of an actual variable, and <text> is some template text. IFDEF is an abbreviation for “if defined”; IFNDEF, for “if not defined”. The square brackets mean that the element can occur zero or one times. The curly brackets mean that the element can occur zero or more times. The round brackets are used for grouping. The vertical line means using one of the available options. Conditional statements can be nested.

Example:

%IFDEF(IS_MULTIPLE_PARTS)%
  %IFNDEF(IS_ONLY_ONE_PART)%
    
<p>Use the links below to navigate through parts:</p>
    
<p>
      %IFNDEF(IS_FIRST_PART)%
      
<a href="%FIRST_PART_LINK%">Start</a>
        %IFNDEF(IS_SECOND_PART)%
         
<a href="%PREVIOUS_PART_LINK%">Prev</a>
        %ENDIF%
      %ENDIF%
      %IFNDEF(IS_LAST_PART)%
        %IFNDEF(IS_PENULTIMATE_PART)%
         
<a href="%NEXT_PART_LINK%">Next</a>
        %ENDIF%
      
<a href="%LAST_PART_LINK%">End</a>
      %ENDIF%
    
</p>
  %ELSE%
    
<p>Only one part in the document!</p>
  %ENDIF%
%ELSE%

  <p>This is single-part document!</p>
%ENDIF%