|Scroll Prev Top Next More|
In addition to importing HTML and text files you can also use a command that enables you to merge external HTML files into existing topics at publish time. This can be very useful if you have material that changes frequently. You can maintain it in an external HTML file and automatically merge the latest version into your project when you publish.
This only works in HTML-based output formats. Merged HTML files are not included in PDF, printed manuals and MS Word DOCX output.
Remember that the #MERGE command injects the entire external HTML file. If you use it to insert an HTML file in the middle of an existing topic, it will also paste in all the information that is normally in the head section of the HTML page. Since this already exists in topic files, inserting a full HTML page into a topic with #MERGE would create an invalid HTML page. This may work because most browsers are quite forgiving, but it can also cause problems.
Because of this, it is advisable to remove everything in the external file outside the opening and closing <body> and </body> tags, and those tags as well, when merging into topic pages. Basically, such files should only contain normal HTML text, without the additional sections needed for independent pages.
Step 1: Preparing a full page for insertion inside a topic:
1.Open the external HTML file in an editor.
2.Locate the opening <body> tag and delete it and everything that comes before it.
3.Locate the closing </body> tag and delete it and everything that comes after it.
4.Save the file with the .htm or .html extension.
Step 2: Insert the #MERGE command in your topic
1.In the Help+Manual editor click in the position in the topic where you want to insert the contents of the external HTML file.
2.Select the HTML Code Object tool in Write > Insert Object. Make sure that the option HTML code must not be enclosed in a block tag at the bottom of the dialog box is selected. Then type the following code in the editing window, replacing filename.htm with the name of your HTML file:
This assumes that the HTML file is in the project directory (i.e. the directory containing your Help+Manual project). You must include the path to the file if it is stored somewhere else. However, the files you import must be installed on your local file system. You cannot import files from the Internet using http:// references with the #MERGE command.
IMPORTANT: Make sure that there is no additional text inside the code object – no additional spaces before or after the text shown above, and no additional lines!
This method is incompatible with most skins and templates!
This is a method that should only be used in very special cases where you completely understand the HTML code you are using and the results it will produce. It will be incompatible with most skins in templates included with Help+Manual and all Premium Pack skins without exception. In the huge majority of cases the insertion method described above is the only method you should use.
It's important to understand that the #MERGE command inserts the entire HTML file it references. Since HTML files are normally complete, with all the header and layout information they need, you don't want the page components that are normally used for Help+Manual topic pages. You need to create a special HTML topic page template that does not contain this information; otherwise you will have two pages in one, nested inside each other.
The solution here is to create an empty HTML topic page template that only contains the variable for inserting the content from your topic page.
Step 1: Create a special HTML page template for merged HTML files
1.In your project, go to Project Explorer: Configuration > HTML Page Templates, click on Add to create a new page template and give the template a descriptive Name like External.
2.Select the new template, and in the Source Code tab select all the code and delete everything.
3.Type in the variable <%TOPIC_TEXT%> in the Source Code tab, so that this is the only content. It should look like this:
4.IF YOU ARE USING A SKIN:
Step 2: Create the topic with the #MERGE command to insert the file
1.Create an empty topic in the position where you want to insert the file.
2.Select the Topic Options tab on the left of the main editor window, and in the HTML Page Template: field select the External template you created in step 1 above.
3.Click in the Help+Manual editor and select the HTML Code Object tool in Write > Insert Object and type the following code in the editing window, replacing filename.htm with the name of your HTML file:
This assumes that the HTML file is in the project directory, i.e. the directory containing your Help+Manual project. You must include the path to the file if it is stored somewhere else. However, the files you import must be installed on your local file system. You cannot import files from the Internet using http:// references with the #MERGE command.
IMPORTANT: Make absolutely sure that there are no spaces or other characters before or after the HTML code object. It should be the only thing in the topic page when you use this method! Similarly, there should be no additional text inside the code object – no additional spaces before or after the text shown above, and no additional lines!