Suppress cross-references if target is missing?

This forum is for all Flare issues not related to any of the other categories.
Post Reply
techwriterkai
Propeller Head
Posts: 66
Joined: Wed Oct 12, 2011 5:27 am
Location: @techwriterkai
Contact:

Suppress cross-references if target is missing?

Post by techwriterkai »

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.
Documentation: Helping users look good and suck less.
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: Suppress cross-references if target is missing?

Post by NorthEast »

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?

Post by techwriterkai »

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... :wink:

If anyone else has a workaround or another idea, please still share it below. Many thanks!
Documentation: Helping users look good and suck less.
i-tietz
Propellus Maximus
Posts: 1219
Joined: Wed Oct 24, 2007 4:13 am
Location: Fürth, Germany

Re: Suppress cross-references if target is missing?

Post by i-tietz »

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 ...
Inge____________________________
"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?

Post by techwriterkai »

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.
Documentation: Helping users look good and suck less.
Post Reply