Page 1 of 1

Linked variables? Possible or impossible?

Posted: Tue Jun 10, 2014 12:44 am
by CATERAF
Hallo,

I don't know whether what I am about to ask is possible (in the way i'd like), but I'm asking just-in-case!

I am looking for a way so that every time a word is mentioned in Flare, a hyperlink is used.
I know that I could do this using a snippet for each word/set of words, but because it's only for one word (or a series of words) I think it would be better to be a variable; update the word and it updates everywhere throughout Flare. But can you add a hyperlink, cross-reference (or any other kind of link) to a variable? I had a quick look and through Flare's interface and at first look, it doesn't seem possible. However, perhaps there is a way to add a cross-reference through the .flvar file? Or through some other sneaky method I don't know about? Or, do you think it would be better to just use a snippet for each word/set of words?

While I'm asking, is there a way to use a cross-reference without using the first heading of the cross reference? I always want my links to update to the same 'topic' but I don't want it displaying the heading of the topic..

Thanks! :-)

Re: Linked variables? Possible or impossible?

Posted: Tue Jun 10, 2014 1:30 am
by NorthEast
A variable is text only, so the variable itself can't contain a hyperlink, but you can create a hyperlink and then insert a variable inside it.

If you plan to re-use the link, then it'd make sense to put it inside a snippet.
(And you could still use a variable inside the snippet, if you plan to change the variable at the target level.)

Or if you used a cross-reference, then the link text would be generated automatically - this is based on your MadCap|xref format, so it's not necessarily the heading, but it has to come from something in the topic.

Re: Linked variables? Possible or impossible?

Posted: Tue Jun 10, 2014 1:41 am
by CATERAF
Thanks :-) That's helpful and may be the way I have to do it.
Dave Lee wrote: Or if you used a cross-reference, then the link text would be generated automatically - this is based on your MadCap|xref format, so it's not necessarily the heading, but it has to come from something in the topic.
So there's not really a way to specify the text I want the cross-reference to have? It has to come from something inside the topic? That's a bit tricky -- it means I'd have to use hyperlinks rather than cross-references I'd say..

Thanks for the help!

Re: Linked variables? Possible or impossible?

Posted: Tue Jun 10, 2014 3:22 am
by NorthEast
CATERAF wrote:So there's not really a way to specify the text I want the cross-reference to have? It has to come from something inside the topic? That's a bit tricky -- it means I'd have to use hyperlinks rather than cross-references I'd say..
The whole point of using a cross-reference, is that the cross-reference link text is generated for you, based on the xref format. The xref format doesn't necessarily include text from the topic (it just usually does), the format is whatever you set it to be.

If you need to edit the link text manually, you'd use a hyperlink.

Re: Linked variables? Possible or impossible?

Posted: Tue Jun 10, 2014 7:05 am
by doc_guy
You can create a class of the xref tag and modify the text. And you can point an XREF at any heading in the topic - or even any paragraph in the topic, but the whole block will be displayed in the XREF. So if you point to a H5 inside the topic, you'd just get the content of the H5. If you pointed at a paragraph in the topic, you'd get the whole paragraph as the "link" in the XREF.

The other point of the XREF is to provide page numbers in printed output, which is different than links. In a XREF you get something like: "See Widget Instructions on page 27." Where your link would be "Widget Instructions" (Or whatever text you put there).