Applying LinkTextResolver for ditamaps

Post here questions and problems related to oXygen frameworks/document types.
abhik
Posts: 17
Joined: Tue Sep 05, 2023 12:14 am

Applying LinkTextResolver for ditamaps

Post by abhik »

Hi Team,

We are extending LinkTextResolver to resolve references to custom text in Editor (for both ditamaps and topics)
We are following this guide: https://www.oxygenxml.com/doc/versions/ ... -text.html

This is the css file that we are using.

Code: Select all

xref, topicref {
    content: oxy_link-text();
}
In case of dita topics, it is replacing the default text with the resolved text in link element (xref in this case).
Please check screenshot Topic_with_resolved_xref.png where we resolved xref in topic with LinkTextResolver.
Topic_with_resolved_xref.png
Topic_with_resolved_xref.png (38.3 KiB) Viewed 510 times
But in case of ditamaps, it is appending resolved text next to the link element (topicref in this case).
Please check screenshot Map_with_resolved_topicref.png where we resolved topicref in ditamap with LinkTextResolver.
Map_with_resolved_topicref.png
Map_with_resolved_topicref.png (42.94 KiB) Viewed 510 times
Similar to dita topics, we want to replace link text in ditamaps with the resolved text.
We request you to suggest solution to replace link text with the resolved text for ditamaps.


Thanks & Regards,
Abhi_K
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Applying LinkTextResolver for ditamaps

Post by Radu »

Hi,
If you right click inside a topicref in the Author visual editing mode you can use the "Inspect Styles" action to show the "CSS Inspector" view.
https://www.oxygenxml.com/doc/versions/ ... -view.html
Using the CSS inspector view you have tabs for each before/after level on which there were CSS styles added. And for each level you can navigate to the CSS selector.
For example in the CSS Oxygen XML Editor/frameworks/dita/css/core/-map-basic.css you have this default selector:

Code: Select all

  *[class~="map/topicref"][href]:before(1020) {
     content: oxy_unescapeURLValue(attr(href)) " ";
  }
  
which displays the href attribute value and which you can override in your custom CSS to set an empty content to the same selector and avoid showing the href attribute value.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
abhik
Posts: 17
Joined: Tue Sep 05, 2023 12:14 am

Re: Applying LinkTextResolver for ditamaps

Post by abhik »

Hi Radu,

Thank you for your valuable response. Your insight is helping us to develop further.

Regards,
Abhi_K
Post Reply