Navigation: Conditional Compilation >

Conditions in HTML Code

Send comments on this topic.

  

 

The HTML Editor used in HelpSmith for HTML code insertions and for editing HTML-based templates allows you to define if a block of the HTML code should be included depending on the Build Tags selected during the compilation.

 

You can use the following syntax within your HTML code to define a conditional block.

 

Basic Condition


<IF_#HTMLHelp>Some code or text</IF_#HTMLHelp>,

 

where #HTMLHelp is the ID of the build tag (as defined in project options) which means that this block will be included only if the given build tag is selected during the compilation.

 

Negative Condition


<IFNOT_#HTMLHelp>Some code or text</IFNOT_#HTMLHelp>,

 

where #HTMLHelp is the ID of the build tag (as defined in project options) which means that this block will be included only if the given build tag is NOT selected during the compilation.

 

Implement the OR Logic


If you need to implement the OR logic, you can use the following syntax:

 

<IF_#HTMLHelp|#WebHelp>Some code or text</IF_#HTMLHelp|#WebHelp>,

 

which means that this block will be included only if either #HTMLHelp or #WebHelp build tag is selected during the compilation.

 

Implement the AND Logic


If you need to implement the AND logic, you can use nested blocks like this:

 

<IF_#HTMLHelp><IF_Custom1>Some code or text</IF_Custom1></IF_#HTMLHelp>,

 

which means that this block will be included only if both #HTMLHelp and Custom1 build tags are selected during the compilation.

 

Related Topics


Conditional Compilation: Overview

Editing Build Tags

Defining Conditions

Including/Excluding Help Topics

Conditional Text

Compiling Help Project with Build Tags

Processing Dead Links



Copyright © 2007-2019 HelpSmith.com