Keyword Links (KLinks)

The topic and pop-up links we discussed above are one-to-one links. They take the reader from the current topic directly to another.

Keyword links are one-to-many links. They may take the reader from the current topic to any topic that contains the keyword specified by the link. (When the user clicks the link, a dialog box appears listing all the available destinations.)

So before we add any keyword links to our sample project, we need some keywords to link to.

1.   Open the Learn to Dive document in your HTML editor.

2.   Find the PADI Scuba Experiences for Kids topic.

3.   Select SASY, the first word in the topic text.

4.   Click the Keyword button  in the toolbar. The Keyword dialog box opens.

5.   Click the Add button in the dialog and type the keyword Kids.

6.   Click OK to close the dialog box.

The keyword Kids is now associated with the PADI Scuba Experiences for Kids topic. Look at the HTML source and notice how that was done. As before, it is just a <span> tag with a special Doc-to-Help style (C1HIndex).

D2HML syntax: Adding Keywords

<span class="C1HIndex">SASY</span>
<span class="C1HIndex">SASY
<span style="display:none">|keyword=Kids</span></span>

Now that we have a keyword defined, let's create a link to it.

1.   Scroll back to the top of the document and locate the Starting the Adventure topic.

2.   Select the word Kids in the second paragraph (Kids are welcome too).

3.   Click the Keyword Link button  in the toolbar. The Keyword Link dialog box opens.

4.   Click OK to accept the default and use the selected text as a target keyword.

5.   Close the file.

D2HML syntax: Adding Keyword Links

<span class="C1HKeywordLink">Kids</span>
<span class="C1HKeywordLink">Kids
<span style="display:none">|keyword=Kids</span></span>

So far we have added a new keyword to the document (it will appear in the Index tab in the help system) and we have also added a link to it.

This is not very interesting because the keyword is associated with a single topic. To create a one-to-many link as we described above, let's assign the Kids keyword to a different topic.

1.   Open the FAQ Age Requirements document in your HTML editor.

2.   Select 12 years old in the topic text.

3.   Click the Keyword button  in the toolbar. The Keyword dialog box appears.

4.   Click the Add button in the dialog and type the keyword Kids again.

5.   Click OK to close the dialog box.

6.   Save and close the file.

D2HML syntax: Adding Keywords

<span class="C1HIndex">12 years old</span>
<span class="C1HIndex">12 years old
<span style="display:none">|keyword=Kids</span></span>

Now rebuild the help file and open it.

Select the Starting the Adventure topic and click the keyword link Kids we just added.

A dialog box will pop up showing the two topics that were assigned the keyword Kids, as shown below.

Keyword links are closely related to the help system's index, an important feature we will discuss later. For now, it is enough to remember that a keyword may be associated with one or more topics, and that a keyword link will take the reader to any of those topics.