How to convert regular hyperlink to reference in print?

This forum is for all Flare related Tips and Tricks.
Have a tip or trick you use while working in Flare? Share it here.
Post Reply
Ericam
Propeller Head
Posts: 39
Joined: Thu Apr 02, 2009 2:18 pm

How to convert regular hyperlink to reference in print?

Post by Ericam »

Is there a way to have a hyperlink convert to a "Go to page" for the print document. I looked at cross-reference links, but that seems different. I just want my "regular" hyperlinks to automatically convert for print.

Thanks
Nita Beck
Senior Propellus Maximus
Posts: 3669
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: How to convert regular hyperlink to reference in print?

Post by Nita Beck »

To achieve the behavior you're seeking, you should use cross-references, not hyperlinks.

You can define the MadCap|xref style in your stylesheet so that it looks just like a hyperlink (blue underlined, no reference to a page) in your online target and just like a print-based cross-reference (with or without quotation marks, not underlined, not blue, with a reference to a page) in your print target. You'd define its hyperlink qualities for the default medium and the cross-reference qualities for the print medium. (Or, if you like to use different stylesheets altogether, rather than mediums, just make sure that you've got the same named xref style in each stylesheet and then set them up in each as needed.)

I think the Flare Help is pretty good about explaining how to set up and use cross-references. I have personally heard MadCap's tech writer talk about how he prefers to use cross-references over hyperlinks, even in topics that he doesn't intend to output to a print target. The beauty of a cross-reference -- besides how it can be rendered differently for different media -- is that its text (not just the underlying link) will update automatically if you change the heading of the topic it's referencing.

I hope this gives you enough to get started.
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
DurtyMat
Sr. Propeller Head
Posts: 224
Joined: Wed Aug 22, 2007 8:09 am
Location: ClrH2o, Fl

Re: How to convert regular hyperlink to reference in print?

Post by DurtyMat »

when we made the conversion from hyperlinks to xrefs we were able to do a Find and Replace (FnR) to make the transistion pretty quick, assuming you dont have any special characteristics in your links (conditions, inline styles, etc) a quick FnR should get you on the xref train pretty quick.

Plain hyperlink

Code: Select all

<p><a href="clickme.htm">Click Me</a></p>
Cross Reference (don't know how plain this is)

Code: Select all

<p><MadCap:xref href="clickme.htm" target="" title="" alt=""><span style="color: #0000ff;" class="mcFormatColor"><u>Click Me</u></span>(<i><span style="color: #0000ff;" class="mcFormatColor"><u>on page 1</u></span></i>)</MadCap:xref></p>
FnR
Find: a href= (no space after the '=')
Replace: MadCap:xref href= (no space after '=')

Check, Find in source code

This will make the hyperlinks look like plain text (until you select Tools > Update Cross-References... from the main menu (which is per topic, grrrrr) ) or just build and the xrefs will come out like the default madcap.xref style class. Let me know if you have any issues or more questions.
*the additional xref code will show up when updated / prolly after a build ....
Flare: I bought it ... so that means I can break it, right?
NorthEast
Master Propellus Maximus
Posts: 6372
Joined: Mon Mar 05, 2007 8:33 am

Re: How to convert regular hyperlink to reference in print?

Post by NorthEast »

If you do that, you'd also need to do a second find and replace to change the closing tags; i.e. replace </a> with </MadCap:xref>.
However, bear in mind bookmarks also use the a (anchor) tag, so do it one-by-one rather than replace all.

Note that anything (text, tags, etc.) between the opening and closing MadCap:xref tags is completely irrelevent; it's just a placeholder that will be replaced entirely when the topic is built.
DurtyMat
Sr. Propeller Head
Posts: 224
Joined: Wed Aug 22, 2007 8:09 am
Location: ClrH2o, Fl

Re: How to convert regular hyperlink to reference in print?

Post by DurtyMat »

oops, i forgot to add the closing tag search .... doh!
Flare: I bought it ... so that means I can break it, right?
Post Reply