Page 1 of 1

Display shortdesc of target topic in imagemap

Posted: Thu May 23, 2019 12:47 pm
by Anne
Hi,

I found a similar topic dated back to 2015:
post33485.html?hilit=imagemap%20shortdesc#p33485

Is there an easier solution in 2019?

Thanks,
Anne

Re: Display shortdesc of target topic in imagemap

Posted: Mon May 27, 2019 8:17 am
by Radu
Hi Anne,

Sorry but as this is not a common request we do not have a parameter to enable such behavior. So an XSLT customization would indeed be needed for this.

Regards,
Radu

Re: Display shortdesc of target topic in imagemap

Posted: Mon May 27, 2019 12:50 pm
by Anne
Hi Radu,

As suggested in the mentioned post, I modified the file ut-d.xsl with the following:
<xsl:variable name="alttext"><xsl:apply-templates select="*[contains(@class, ' topic/xref ')]/*[contains(@class, ' topic/desc ')]" mode="text-only"/></xsl:variable>

however this didn't seem to work. Is anything else needed?

Thanks,
Anne

Re: Display shortdesc of target topic in imagemap

Posted: Mon May 27, 2019 2:01 pm
by Radu
Hi Ann,

On that older forum post my suggestion was about making changes to the XSLTs in the "org.dita.xhtml" plugin.
About 1-2 years ago our WebHelp started to be based on the "org.dita.html5" plugin which has similar XSLT stylesheets.
So you would either need to make a change in the stylesheets for the html5 plugin or create a new DITA OT plugin which adds an extension for the HTML5 publishing overriding that base XSLT template.

If you will not be able to make this work I can try to look again at the code, and maybe come up with such a plugin in a couple of days.

Regards,
Radu

Re: Display shortdesc of target topic in imagemap

Posted: Mon May 27, 2019 3:00 pm
by Anne
I made the same change to the file ut-d.xsl under the "org.dita.html5" plugin, namely \dita-ot\plugins\org.dita.html5\xsl\ut-d.xsl , and ran a DITA Map Webhelp responsive transform. Alas, the same result. Is this the right file?

Re: Display shortdesc of target topic in imagemap

Posted: Tue May 28, 2019 10:41 am
by Radu
Hello Anne,

I created a DITA Open Toolkit plugin which should do what you want:

https://github.com/oxygenxml/dita-html- ... desc-links

Regards,
Radu

Re: Display shortdesc of target topic in imagemap

Posted: Tue May 28, 2019 11:57 am
by Anne
Hi Radu,

First, thank you very much for taking time to create this plugin. Unfortunately, it didn't work for me.
Here's what I did:
1. Downloaded the project as ZIP.
2. Extracted the folder com.oxygenxml.shortdesc.imagemap to the \Oxygen\docs-dita-tools\dita-ot\plugins folder.
3. In Oxygen, ran the Run DITA-OT integrator. The build was successful.
4. Restarted Oxygen.
5. Ran a standard DITA Map Webhelp Responsive transform on my bookmap that includes a topic with an imagemap.
6. Checked the results: the tooltips on the image map still display the topic names rather than their shortdescs. :-(

Did I do anything wrong?

Thanks and regards,
Anne

Re: Display shortdesc of target topic in imagemap

Posted: Wed May 29, 2019 8:10 am
by Radu
Hi Anne,

You seem to be doing all the right things.
I just tested the plugin again with the DITA OT 3.x bundled with Oxygen 21.1 and it works for me. I'm testing with a very basic image map which looks like this:

Code: Select all

            <imagemap>
                <image href="../../images/Iris_sanguinea.jpg" scale="50"/>
                <area>
                    <shape>rect</shape>
                    <coords>50, 50, 100, 100</coords>
                    <xref href="../care.dita"/>
                </area>
            </imagemap>
Do those target topics actually have the shortdesc added to them?
Do you produce WebHelp responsive using the same DITA OT to which you made changes? Is that custom DITA-OT set as the default used DITA-OT in the Oxygen Preferences->DITA page?
Can you maybe debug the "DITA-OT3.x\plugins\com.oxygenxml.shortdesc.imagemap\xhtml.xsl" stylesheet on your side? Add an xsl:message inside the xsl:template, then in the Preferences->"DITA / Logging" page check the "Show console output->Always" radio button, run the transformation and see if in the DITA OT console view at the bottom of the application your message appears...

Regards,
Radu

Re: Display shortdesc of target topic in imagemap

Posted: Wed May 29, 2019 9:56 am
by Anne
Hi Radu,

I found that in my Oxygen Preferences->DITA page DITA-OT was selected as built-in. Once I switched it to the actual custom location and ran a transform, all the shortdescs appeared in tooltips.

Thanks again for your help and persistence!

All the best,
Anne