Is there a way to exclude a cross-reference if the reference target is deliberately missing in the TOC and the target output?
We sometimes include "regular" topics from our complete online help in our release notes which only describe new features. Such "regular" topics may include cross-references which are fine in the complete online help, but they create dead links in the context of the release notes. Can we somehow exclude the cross-reference text if the target is missing?
Thanks in advance! Cheers, Kai.
Suppress cross-references if target is missing?
-
techwriterkai
- Propeller Head
- Posts: 66
- Joined: Wed Oct 12, 2011 5:27 am
- Location: @techwriterkai
- Contact:
Suppress cross-references if target is missing?
Documentation: Helping users look good and suck less.
Re: Suppress cross-references if target is missing?
There isn't an automatic way to do this, you'd need to set a condition on the cross-reference.
-
techwriterkai
- Propeller Head
- Posts: 66
- Joined: Wed Oct 12, 2011 5:27 am
- Location: @techwriterkai
- Contact:
Re: Suppress cross-references if target is missing?
Thanks, Dave, for the fast reply... Yeah, it was a long shot, and I was afraid that function would be too weird to reasonably exist...
If anyone else has a workaround or another idea, please still share it below. Many thanks!
If anyone else has a workaround or another idea, please still share it below. Many thanks!
Documentation: Helping users look good and suck less.
Re: Suppress cross-references if target is missing?
You could stuff the xref into a div with a certain class id.
Then you insert a javascript into the masterpage that grabs those divs "onload" and checks the content: Is it a link? If it isn't => set the display of the div to "none".
You need a good knowledge of the DOM (Document Object Model) for that javascript, especially it you want it to work on multiple browsers.
Drawback:
The text of the link is still inside the topic - it just invisible. Means: It can be found by the search ... might irritate the user if he looks at a topic in which the search string cannot be found ...
Then you insert a javascript into the masterpage that grabs those divs "onload" and checks the content: Is it a link? If it isn't => set the display of the div to "none".
You need a good knowledge of the DOM (Document Object Model) for that javascript, especially it you want it to work on multiple browsers.
Drawback:
The text of the link is still inside the topic - it just invisible. Means: It can be found by the search ... might irritate the user if he looks at a topic in which the search string cannot be found ...
Inge____________________________
"I need input! - Have you got input?"
"I need input! - Have you got input?"
-
techwriterkai
- Propeller Head
- Posts: 66
- Joined: Wed Oct 12, 2011 5:27 am
- Location: @techwriterkai
- Contact:
Re: Suppress cross-references if target is missing?
Thanks, Inge, for this interesting workaround. In our particular scenario, the drawbacks of iffy multi-browser support and the link still being included in the output outweigh the benefits. But I'm sure it's worth considering for a smaller project and a tech-savvy javascript user! Thanks for your contribution.
Cheers, Kai.
Cheers, Kai.
Documentation: Helping users look good and suck less.