Custom Link Text in Cross Reference

This forum is for all Flare issues not related to any of the other categories.
Post Reply
Evetsm
Propeller Head
Posts: 90
Joined: Wed Apr 30, 2014 8:32 am

Custom Link Text in Cross Reference

Post by Evetsm »

Hi,

Is it possible to insert a cross reference and change the actual link text to be other than the default?

Example:

Code: Select all

<MadCap:xref href="Some Topic File.htm">Default text that I want to change</MadCap:xref>
I've run into situations where the default text is not what I want to be displayed.

I found that if I simply change the text (in the Text Editor tab of the topic editor), then in the generated output the text reverts back to what it originally was.

Thanks.
jasonsmith
Sr. Propeller Head
Posts: 205
Joined: Wed Apr 28, 2010 2:51 am

Re: Custom Link Text in Cross Reference

Post by jasonsmith »

xrefs have a defined content, such as (see Figure X). If you want to link from custom text, I would suggest that you would be better off using a Hyperlink, <a href="Some Topic File.htm">Default text that I want to change</a>
Evetsm
Propeller Head
Posts: 90
Joined: Wed Apr 30, 2014 8:32 am

Re: Custom Link Text in Cross Reference

Post by Evetsm »

Thanks, Jason. I'll give that a try.
ChoccieMuffin
Senior Propellus Maximus
Posts: 2650
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Custom Link Text in Cross Reference

Post by ChoccieMuffin »

That's not necessary, and having a hyperlink rather than a cross-ref is a step backwards.

When you insert a cross-ref, you can choose which class of cross-ref you use. I have several. My main one has "[topic title] on page x" in the Print medium and "[topic title]" in the on-screen medium. I keep the word "see" as part of the regular text in the topic.

You can create classes of cross-ref that say whatever it is you want it to say, but be careful to adjust all your mediums.
Started as a newbie with Flare 6.1, now using Flare 2024r2.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Evetsm
Propeller Head
Posts: 90
Joined: Wed Apr 30, 2014 8:32 am

Re: Custom Link Text in Cross Reference

Post by Evetsm »

Thanks, Choccie. I just reviewed the built-in classes and could not find one that appears to do what I want.

I also went through the available commands in the New Cross-Reference Style Class but to no avail. Could you please give an example? I seem to be missing something basic.

To rephrase my question (and I probably was not clear), I would like to do the following:
1. Insert a cross-reference.
2. In the Text Editor, change the default link text to something other than the default.
3. Build the HTML and see the new text.

Example:
I have a cross reference that reads "Copying Files" and I want to change it to "Copying Files Introduction"

Here are the steps I go through:
1. Insert a cross reference.
At this point in the XML Editor, the cross-reference text is "Copying Files"
In the Text Editor, it looks like this:

Code: Select all

<MadCap:xref href="<some file>.htm#Copying_Files_">Copying Files</MadCap:xref>
2. Change the link text so it reads "Copying Files Introduction"
In the Text Editor, I change the cross-reference so it looks like this:

Code: Select all

<MadCap:xref href="<some file>.htm#Copying_Files_">Copying Files Introduction</MadCap:xref>
When I do the above and build the HTML, the cross-reference text reverts back to "Copying Files"

Thanks -- I hope that made more sense.
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: Custom Link Text in Cross Reference

Post by NorthEast »

You'd have to use a hyperlink.
You can't edit the text in an individual cross-reference - the text is generated at build time according to your xref format.
Evetsm
Propeller Head
Posts: 90
Joined: Wed Apr 30, 2014 8:32 am

Re: Custom Link Text in Cross Reference

Post by Evetsm »

Thank you, Dave (and also ChoccieMuffin and Jason)
I'm using hyperlinks and they work perfectly.
Post Reply