I publish documents to PDF and web help format, and have had a long-standing requirement to use custom text with cross references in PDF output.
For example, I want the web help to contain:
You can create a widget.
And I want the PDF to contain:
You can create a widget (see page 54).
Both are references to widget.htm and I want them to have the same text ("You can create a widget"). I don't mind whether the PDF reference is clickable or not, because as a printed doc the reader has the page number to navigate with.
In the past, the only way I'd found of achieving this involved two conditional text tags and repeated text (which was really not ideal, because it often confused translators):
Code: Select all
<MadCap:conditionalText MadCap:conditions="Default.PrintOnly"><a href="widget.htm">You can create a widget</a></MadCap:conditionalText><MadCap:conditionalText MadCap:conditions="Default.ScreenOnly">You can create a widget <MadCap:xref href="widget.htm" class="inline"></MadCap:xref></MadCap:conditionalText>.
Code: Select all
MadCap|xref.inline
{
mc-format: '(see page {page})';
}
However, yesterday I came up with the following code to implement the links, which seems to achieve the same outcome without repeating text:
Code: Select all
<a href="widget.htm" MadCap:conditions="Default.ScreenOnly" MadCap:excludeAction="unbind">You can create a widget</a><MadCap:conditionalText MadCap:conditions="Default.PrintOnly"> <MadCap:xref href="widget.htm" class="inline"> /></MadCap:conditionalText>.