WebHelp: How to achieve one-page glossary with term tooltips?
Posted: Sat Jun 24, 2023 7:47 pm
Hello.
I'd like to achieve the following result using the WebHelp transformation for the glossary:
- One resultant web page with all glossary terms
- Tooltips when the term is mentioned in other topics
I've tried many methods and I failed, ultimately I decided to seek help here...
At the moment, I had to resort to the following soluition:
Each glossary term is seen on separate page
Tooltips are displayed correctly when using <term keyref="term"/>
I achieved this by doing the following:
- Each glossary term is a separate file with a separate <glossentry> topic. For example (simplified):
topic1.dita:
<glossentry id="term1">
<glossterm>Term 1</glossterm>
<glossdef>Definition of term 1.</glossdef>
</glossentry>
glossary.ditamap
<topicref href="topic1.dita" keys="term1"/>
<topicref href="topic2.dita" keys="term2"/>
(...)
Of course, glossary.ditamap is imported into the main ditamap:
<topichead>
<topicmeta><navtitle>Glossary</navtitle></topicmeta>
<topicref href="glossary.ditamap" format="ditamap"/>
</topichead>
I tried using a single glossary definition file using <glossgroup>. However, the result was that while there was one page in the resultant HTML with all glossary terms, whenever a term was displayed, the tooltip contained the <glossdef> from the first term in the <glossgroup>. I tried doing all I can, creating keys, following the tips in this topic: dita-editing-and-publishing-dita-conten ... 15542.html -- nothing seem to have worked.
Could please someone be so kind as to explain to me very simply how do I do this? If I need to use the keys, how do I define them and import them? The simplest possible way, could be keys in main ditamap directly, one glossgroup file, and what I need to reference in the <term> elements in other topics please...
Thank you in advance!
I'd like to achieve the following result using the WebHelp transformation for the glossary:
- One resultant web page with all glossary terms
- Tooltips when the term is mentioned in other topics
I've tried many methods and I failed, ultimately I decided to seek help here...
At the moment, I had to resort to the following soluition:
Each glossary term is seen on separate page
Tooltips are displayed correctly when using <term keyref="term"/>
I achieved this by doing the following:
- Each glossary term is a separate file with a separate <glossentry> topic. For example (simplified):
topic1.dita:
<glossentry id="term1">
<glossterm>Term 1</glossterm>
<glossdef>Definition of term 1.</glossdef>
</glossentry>
glossary.ditamap
<topicref href="topic1.dita" keys="term1"/>
<topicref href="topic2.dita" keys="term2"/>
(...)
Of course, glossary.ditamap is imported into the main ditamap:
<topichead>
<topicmeta><navtitle>Glossary</navtitle></topicmeta>
<topicref href="glossary.ditamap" format="ditamap"/>
</topichead>
I tried using a single glossary definition file using <glossgroup>. However, the result was that while there was one page in the resultant HTML with all glossary terms, whenever a term was displayed, the tooltip contained the <glossdef> from the first term in the <glossgroup>. I tried doing all I can, creating keys, following the tips in this topic: dita-editing-and-publishing-dita-conten ... 15542.html -- nothing seem to have worked.
Could please someone be so kind as to explain to me very simply how do I do this? If I need to use the keys, how do I define them and import them? The simplest possible way, could be keys in main ditamap directly, one glossgroup file, and what I need to reference in the <term> elements in other topics please...
Thank you in advance!