HelpSmith Help
Logo Image

Editing Project Options / HTML Export /

HTML Export: <HEAD> Section

Send comments on this topic

← Previous Next →

1.On the Project tab, in the Project group, click Project Options.

2.In the Project Options dialog, in the left sidebar, under HTML Export, click <HEAD> Section.

3.Define the HTML code that you want to add to the <HEAD> section of the generated HTML files.

4.Click OK.

 

HelpSmith allows you to define HTML code that will be included to the <HEAD> section of the HTML files which are generated during the compilation of your help project to the HTML Help (CHM), Web Help, and ePub formats.

 

For example, you can use this feature to add meta tags, include external styles and scripts, define the favorite icon, or embed any other HTML code that you need.

 

Defining HTML Code for the <HEAD> Section


While editing the HTML code of the <HEAD> section, you can use the capabilities of the HTML Editor that allows you to insert conditions, text variables, color codes, references to images in the media repository, and also to use special tags which define where a particular block of the HTML code will be included.

 

Use Conditions to Define Where to Include the HTML Code


You can use conditions based on build tags, and also special tags that allow you to define where you want to include the HTML code, or a particular block of the HTML code in the compiled documentation.

 

To insert a condition to the HTML code, you should use the following syntax:

<IF_#WebHelp>Some code or text</IF_#WebHelp>

 

For the <HEAD> section, you can use the following tags:

Use Build Tags to include the HTML code to a specific output format (e.g. HTML Help, Web Help, or ePub), or to a specific version of the help system.

Use the #Topic tag to include the HTML code to all the topics of the help system. For the Web Help format, this tag means that the HTML code will be included to the HTML files of topics, but not to the HTML files related to the help system's layout.

Use the #Topic_ID tag (where ID is the Context or ID value of a topic) to include the HTML code to a specific topic only.

Use the #IndexPage, #NaviPage, #UnknownPage, #HeaderTopic, #FooterTopic tags to include the HTML code to the appropriate element of the Web Help system's layout.

 

Remark: If you do not use the tags which define where to include the HTML code, the code will be included to any HTML files generated for the compiled help system.

 

Use Variables to Insert Topic-Related Data


When you define the <HEAD> section of topics, you may need to insert topic-related data directly to the HTML code. For example, when adding the Description and Keywords meta tags, the values of the meta tags should contain the data related to specific topics.

 

For this purpose, you can use text variables which you can define on the project level, and then re-define the values of the variables in specific topics.

 

To insert a variable to the HTML code, you should use the following syntax:

<%VariableName%>

 

Example: HTML Code to Add Meta Tags


For example, you can use the following code that will add the Description and Keywords meta tags for the topics in the HTML Help (CHM) and Web Help systems.

 

<IF_#HTMLHelp|#WebHelp>

  <IF_#Topic>

<meta name="description" content="<%Description%>">

<meta name="keywords" content="<%Keywords%>">

  </IF_#Topic>

</IF_#HTMLHelp|#WebHelp>

 

Remark: Please note that the <IF_#HTMLHelp|#WebHelp> condition defines that the code will be included to the HTML Help (CHM) and Web Help formats, and the nested <IF_#Topic> condition defines that the code will be included to the HTML files of the topics only, but not to the HTML files of the Web Help layout.

 



Copyright © 2007-2024 HelpSmith.com