The regular start file is used when you call the start file of the project, such as newproject.htm. This start file supports the following methods:
- Map numbers.
- Topic id's.
- Relative path to a file in the project.
- Relative path to a file in the project folder but not in the project.
This start file supports the following options:
- Specifying the window you want to use.
- Specify whether you want the help to open in a separate popup.
The regular start file is very flexible since you can use windows (RoboHelp > Project Set-up > Windows) to determine how your help will look: showing or hiding the navigation pane, showing or hiding the toolbar and setting the browser dimensions. I assume you are familiar with windows. One note: Always deselect Use Default Browser Settings in the window definition or the window will not work in Firefox. If you do not want to use a window definition at all but just open the help, consider using the _csh start file.
This start file supports two methods of calling the WebHelp. The first method is the regular method that is used by the default RoboHelp JavaScript API and my custom APIs. The other method is an internal method that the WebHelp uses when you call the WebHelp using the regular method: When you call the help using the regular method, the WebHelp reads the window definition and other settings and redirects using the internal method.
Calling WebHelp
Say that we have a fictitious context sensitive WebHelp project published on http://localhost/newproject.htm. The file newproject.htm is the start file of the project. In this section I will show you how to create a URL to call this WebHelp project.
Default method
To trigger the context sensitivity, add #< after the path of the project start file:
http://localhost/newproject.html#<
After these characters, you can specify the options. You have to separate multiple options with >>. You can use the following options:
| OPTION | EXPECTED VALUE | DESCRIPTION |
|---|---|---|
| id | Map number | Call using a map number. If you specify both a map number and a topic id, the help shows the topic corresponding with what is listed first in the URL. |
| str | Topic id | Call using a topic id. The topic id is case sensitive. If you specify both a map number and a topic id, the help shows the topic corresponding with what is listed first in the URL. |
| url | Path to file | A file in the project directory. This will show the file without the skin. The file may be a topic from the project or another file. The path must be relative from the project root. |
| topicurl | Path to file | A file in the project directory. This will show the file and the skin. The file may be a topic from the project or another file. The path must be relative from the project root. |
| wnd | Window name | The name of the window you want to use. The window name is case sensitive. You need to create the window in the RoboHelp project. |
| cmd | Pane code | The pane to open: toc for TOC, idx for index, fts for search, glo for glossary and none for the navigation pane hidden (but the toolbar is visible). |
| newwnd | Boolean | Set to false to open the help in the same window (do not create a popup). Set to true to create a popup. A popup is created by default. RoboHelp 8 and higher only. |
| java | Boolean | Set to false to open the help in the same window (do not create a popup). Set to true to create a popup. A popup is created by default. RoboHelp 7 (and possibly below) only. |
Note the following:
- If you use the option cmd, you cannot use context sensitivity. The project will always open the default topic even if you specify an id and a window.
- You can only specify a window if you use id, str, url or topicurl.
- You may define the options in any order you want.
- The Firefox default popup blocker blocks the help popup for WebHelp. If you support Firefox, consider setting newwnd=false.
For example, if you want to call the topic with map number 3 without creating a popup, use the following URL:
http://localhost/newproject.htm#<id=3>>newwnd=false
Another example: if you want to call the topic with topic id MyTopic in a popup and using the window NoNavPane1, use the following URL:
http://localhost/newproject.htm#<str=MyTopic>>wnd=NoNavPane
Using a window and not opening in a popup
When you use a window defintion, you may expect to be able to use >>newwnd=false to open the help in the same browser window:
http://localhost/newproject.htm#<str=MyTopic>>wnd=NoNavPane>>java=true (RoboHelp 7) http://localhost/newproject.htm#<str=MyTopic>>wnd=NoNavPane>>newwnd=false (RoboHelp 8 and above)
to open the help in the same browser window. In RoboHelp 8 and 9, you can't just use >>newwnd=false because of a small bug in WebHelp. To fix this bug, you need to modify the file whcsh_home.htm as follows:
- Open whcsh_home.htm in a text editor or HTML editor.
- Go to the function
SwitchURL(); - Find the second instance of
if(gsWindow)on line 210 (RoboHelp 8). - Change the if statement
if(gsWindow)toif(gsWindow && gsNewWnd == "true"):
else
{
if(gsWindow && gsNewWnd == "true")//This line has been changed
{
var nTop=getSValue(oWnd.sBTop,screen.height);
var nLeft=getSValue(oWnd.sBLeft,screen.width);
var nWidth=getSValue(oWnd.sBWidth,screen.width);
var nHeight=getSValue(oWnd.sBHeight,screen.height);
window.resizeTo( nWidth , nHeight);
window.moveTo(nLeft , nTop);
}
document.location=sURL;
}
- Save changes and close whcsh_home.htm.
You can now use a window defintion and open the help in the browser window instead of opening in a popup.
Internal method
To trigger the context sensitivity, add # or #>> after the path of the project start file:
http://localhost/newproject.htm# http://localhost/newproject.htm#>>
Then add the relative path to the topic you want to open:
http://localhost/newproject.htm#mydir/mytopic.htm
The difference between # and #>> is that the first method expects a relative path to a topic. If you do not want to specify a topic, you must add #>> after the URL. If you only add a hash, the WebHelp will think that the first option you specify is a relative path to a topic. This means that the >> directly after the # is optional when you specify a relative path.
Note: If you do not specify a relative path, the project opens the default topic.
After specifying the relative path, you can specify the options. You have to separate multiple options with >>. You can use the following options:
| OPTION | EXPECTED VALUE | DESCRIPTION |
|---|---|---|
| cap | string | Set the title of the help project. |
| cmd | number | Sets the default pane that is shown: 0 for no pane, 1 for the TOC, 2 for the index, 3 for the search and 4 for the glossary. |
| pan | number | Determine whether the navigation pane and the toolbar are shown: 1 to show only the topic (navigation pane and toolbar hidden) or a 2 to show the toolbar and navigation pane. The script only checks for a 1 or any other number. The scripts in the WebHelp itself use 2. |
| pbd | string | Sets the default pane that is shown. This parameter only works when use the regular method. Use cmd instead of this function. The available settings are: toc for the TOC, ndx for the index, nls for the search and gls for the glossary. |
| pbs | string | Available panes set by the window definition. This parameter has no effect on the WebHelp. |
| pot | number | Holds the window option. The only option I could find: If set to 1, it disables browse sequences in the minibar. |
For example:
http://localhost/newproject.htm#mydir/mytopic.htm>>cmd=1,pan=2 http://localhost/newproject.htm#>>mydir/mytopic.htm>>cmd=1,pan=2
Note: When you want to call the relative path, you must specify the relative path before you specify any options. Otherwise the help will not open the correct topic.
This method for context sensitivity uses the following files:
- Start file
- whstart.js
- whcsh_home.htm
- whcshdata.htm
- 1. This is not a default RoboHelp window. You need to create all windows yourself in the RoboHelp project.
