Glossary

Having trouble installing Oxygen? Got a bug to report? Post it all here.
dcjohn_maria
Posts: 6
Joined: Tue Nov 28, 2023 8:21 pm

Glossary

Post by dcjohn_maria »

When the user hovers over a glossary term, a short definition (content from <glossSurfaceForm>) should appear in the bubble. A more detailed definition should be present in the actual glossary section. How do we achieve this?
I tried embedding the longer definition within the text tag and used display:none in the CSS. It didn't work.
Sample igmp_gloss.dita file

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE glossentry PUBLIC "-//OASIS//DTD DITA Glossary Entry//EN" "glossaryentry.dtd">
<glossentry id="gloss_igmp">
    <glossterm>Internet Group Management Protocol</glossterm>
    <glossdef>Internet Group Management Protocol </glossdef>
    <glossBody>
        <glossSurfaceForm>Internet Group Management Protocol (IGMP)</glossSurfaceForm>
        <glossAlt id="glossAlt_xcf_24m_d2c">
            <glossAcronym>IGMP <text> is a network protocol that allows devices to share an IP
                    address and receive the same messages. It's used to set up multicasting on IPv4
                    networks. </text></glossAcronym>
        </glossAlt>
    </glossBody>
</glossentry>
julien_lacour
Posts: 665
Joined: Wed Oct 16, 2019 3:47 pm

Re: Glossary

Post by julien_lacour »

Hello,

In HTML-based scenarios, like DITA Map HTML5 or DITA Map WebHelp Responsive, the tooltip that appears when hovering the <term> or <abbreviated-form> element referring the glossentry shows the content of the <glossdef>.

As explained in the DITA specification: Then, when you refer the entry in an <abbreviated-form> for example, the first occurrence will display the <glossSurfaceForm> and the following one(s) will display the <glossAcronym>. All the details and examples can be found in the DITA specification. The process is identical if you use <term> to refer the glossentries.

In your example, you should better set the glossentry like this:

Code: Select all

<glossentry id="gloss_igmp">
    <glossterm>Internet Group Management Protocol</glossterm>
    <glossdef>Internet Group Management Protocol is a network protocol that allows devices to share an IP address and receive the same messages. It's used to set up multicasting on IPv4 networks.</glossdef>
    <glossBody>
        <glossSurfaceForm>Internet Group Management Protocol (IGMP)</glossSurfaceForm>
        <glossAlt id="glossAlt_xcf_24m_d2c">
            <glossAcronym>IGMP</glossAcronym>
        </glossAlt>
    </glossBody>
</glossentry>
And when you will hover the terms, you should get a tooltip containing: "Internet Group Management Protocol is a network protocol that allows devices to share an IP address and receive the same messages. It's used to set up multicasting on IPv4 networks."

Regards,
Julien
dcjohn_maria
Posts: 6
Joined: Tue Nov 28, 2023 8:21 pm

Re: Glossary

Post by dcjohn_maria »

Hi Julien,
Thanks for the response.
Our requirement is that when the user hovers over the term, only a portion of the gloss definition must be displayed. In this case, it should be just "Internet Group Management Protocol," and the rest should be suppressed.
I see that during 2021, already a request was submitted for this feature. Please check the following link.
post74868.html?hilit=glossary#p74868

Regards,
Diana
julien_lacour
Posts: 665
Joined: Wed Oct 16, 2019 3:47 pm

Re: Glossary

Post by julien_lacour »

Hello,

Currently the WebHelp Responsive output is compliant with the DITA specification, that mentions:
One possible implementation of a glossary in online processing is to associate a hotspot for mentions of terms in <term> elements and display the definition on hover or click.
The problem in this situation is that how can we evaluate "a portion of the gloss definition", as the result may differ depending on the requirement of each output.

A solution could be to use an XSLT stylesheet that extends the com.oxygenxml.webhelp.xsl.dita2webhelp extension point and which overrides the @title attribute of the link so that when you hover it, only this portion of text is displayed.
There's an example of how to use such extension point in our user guide.

Regards,
Julien
Post Reply