DITA webhelp output - how to change hovertext for <term> element?

Post here questions and problems related to editing and publishing DITA content.
dariahutch
Posts: 4
Joined: Fri Jan 20, 2012 2:29 am

DITA webhelp output - how to change hovertext for <term> element?

Post by dariahutch »

In the DITA webhelp output, an xref link shows the shortdesc of the target topic when you hover over it. I want to have the same behavior for <term keyref> links to glossary entry topics. Right now it shows the topic title in the hover text instead of the shortdesc in the hover text. How can I change that?
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: DITA webhelp output - how to change hovertext for <term> element?

Post by Radu »

Hi,

If you look in this XSL:

OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/xsl/xslhtml/dita2htmlImpl.xsl

it contains a template called:

Code: Select all

<xsl:template match="*[contains(@class,' topic/term ')]" name="topic.term">....
That template contains 2 variables called:

Code: Select all

<xsl:variable name="displaytext">....
which is the link text and:

Code: Select all

<xsl:variable name="hovertext">....
which is the tooltip which appears on such a link.

The "hovertext" seems to look mostly at glossSurfaceForm so if your glossentry has a content like:

Code: Select all

<glossentry id="glossentry_5ym_llv_4f">
<glossterm>Data Definition Language</glossterm>
<glossBody>
<glossSurfaceForm>THE SURFACE FORM</glossSurfaceForm>
</glossBody>
</glossentry>
Then the hovertext tooltip will be computed to be THE SURFACE FORM.

http://docs.oasis-open.org/dita/v1.2/os ... urfaceForm

But the "displaytext" variable also prefers the surface form if the term keyref is the first keyref in the topic.
The idea would be that on the first encounter the surface form is displayed on a link and then on previous references to the key the acronym (<glossterm>) is used instead.

I think that you can make some modifications in the "displaytext" to only show the acronym.

The general idea behind the behavior of acronyms in DITA is explained here:

http://www.oasis-open.org/committees/do ... cronym.pdf

but not everything is implemented properly in the DITA Open Toolkit so you should also check how publishing works in PDF for example.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Stacey
Posts: 44
Joined: Tue Mar 14, 2017 12:36 am

Re: DITA webhelp output - how to change hovertext for <term> element?

Post by Stacey »

Hi Radu:
I'm wondering if the file path has changed for this. I don't see it in my current install (24.1) and I'm using HTML5 output.
Basically, I'd like the hovertext/tooltip seen in webhelp output to be a truncated version of the glossary definition you find if you click on the term. Right now, they output as the same text, which is a little lengthy for the hovertext. (So, the first <p> inside the <glossdef>.)
Thanks :)
Last edited by Stacey on Mon Mar 14, 2022 7:15 pm, edited 3 times in total.
Post Reply