How to remove the href attribute of glossary terms in HTML output?

Post here questions and problems related to editing and publishing DITA content.
tanja
Posts: 39
Joined: Tue Oct 30, 2018 10:49 am

How to remove the href attribute of glossary terms in HTML output?

Post by tanja »

Hi all,

I am wondering if it is possible to remove the href attribute for glossary terms from the HTML output. I would like to keep the hover link text as is in the default output, but not have the possibility to click it. I don't think that this is possible by customization the CSS, and in the list of XSLT extension I don't see an extension point specific for glossary terms.
https://www.oxygenxml.com/doc/versions/ ... mport.html

Is it even possible to do that? And if yes, could you point me in the direction of what needs to done? I am using Oxygen XML Editor version 24.1.

Thanks and best regards,
Tanja
julien_lacour
Posts: 498
Joined: Wed Oct 16, 2019 3:47 pm

Re: How to remove the href attribute of glossary terms in HTML output?

Post by julien_lacour »

Hello Tanja,

Actually it is possible to disable links in a CSS stylesheet by using the pointer-events property.
Is it enough for your use-case?

Regards,
Julien
tanja
Posts: 39
Joined: Tue Oct 30, 2018 10:49 am

Re: How to remove the href attribute of glossary terms in HTML output?

Post by tanja »

Hello Julien,

I am not sure to be honest. Setting the property for dfn has no effect as the href is part of the parent a tag.

Code: Select all

dfn {
   pointer-events: none;
}
I also tried enclosing the dfn in an outputclass called 'tanjaterm'. This works in that pointer-events 'none' is applied, but this also hides the hover text generated from the title attribute.

Code: Select all

div > .tanjaterm {
   pointer-events: none !important;
}
Do you have any ideas how to proceed here?

Thanks and best regards, Tanja
julien_lacour
Posts: 498
Joined: Wed Oct 16, 2019 3:47 pm

Re: How to remove the href attribute of glossary terms in HTML output?

Post by julien_lacour »

Hi Tanja,

In this case you need to use a custom XSLT stylesheet that will remove the @href attribute as you suggested at the beginning, I already did the template you need to use in order to obtain what you want:
template.zip
(1.08 KiB) Downloaded 104 times
Just download the file, then in the Configure Transformation Scenario dialog, create a custom DITA Map WebHelp Responsive scenario and inside the scenario in the Templates tab, choose the custom template (you can directly select the zip but if you further customize it, unzip it and replace the path from zip to opt file).

If you have problems using publishing templates, you can check the Working with Publishing Templates chapter in the user-manual.

Regards,
Julien
tanja
Posts: 39
Joined: Tue Oct 30, 2018 10:49 am

Re: How to remove the href attribute of glossary terms in HTML output?

Post by tanja »

Hi Julilen,

Thanks so much for the template! I tested it, following the steps you describe but, unfortunately, the href attribute is still there in my HTML output. Please find attached a screenshot with the result.

For the test, I set up a test map (attached) with a glossary submap as described in your documentation under https://www.oxygenxml.com/doc/versions/ ... ssary.html and used your template to generate HTML output.
I also tried adding your xsl file to my customized template, with the same result.

Would you be so kind and have a look again?
href_attribute_dfn_html_output.png
href_attribute_dfn_html_output.png (39.54 KiB) Viewed 797 times
Thanks and best regards, Tanja
testmap.zip
(1.6 KiB) Downloaded 112 times
julien_lacour
Posts: 498
Joined: Wed Oct 16, 2019 3:47 pm

Re: How to remove the href attribute of glossary terms in HTML output?

Post by julien_lacour »

Hello Tanja,

You're right, my stylesheet doesn't cover all the use-cases, this one should:
template.zip
(1.16 KiB) Downloaded 140 times
Regards,
Julien
tanja
Posts: 39
Joined: Tue Oct 30, 2018 10:49 am

Re: How to remove the href attribute of glossary terms in HTML output?

Post by tanja »

Hello Julien,

Your updated template worked like a charm :D

Thanks so much for your support.

Best regards, Tanja
Post Reply