Page 1 of 1

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

Posted: Mon Mar 12, 2012 10:17 pm
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?

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

Posted: Tue Mar 13, 2012 1:05 pm
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

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

Posted: Mon Mar 14, 2022 7:07 pm
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 :)