Skip to main content
Participating Frequently
December 23, 2010
Question

Conditional cross references (an easier way?)

  • December 23, 2010
  • 3 replies
  • 1146 views

Hi gurus,

Forgive me if this is an absurdly simple problem, but our team just isn't figuring out an elegant solution.

What we need is two types of crossreference formats - one for print, one for PDF/the web/any other hyperlinkable medium.

We would like the crossrefs to appear as follows:

Print:

[some arbitrary block of text] (see page xx)

PDF

[some arbitrary block of text]

As far as we can tell, FM's crossreferences always GENERATE text based on the building blocks, whereas FM's hyperlinks allow an arbitrary chunk of selected text to serve as the "active" text.  The hyperlink behavior is what we want, in both cases.  We're not interested in pulling the name of the target paragraph, or the page number, or anything else - we just want the text we typed to serve as the link, no matter the format.

The only solution we've been able to figure out is to actually create both a hyperlink AND a crossreference, and then conditionalize the crossreference (show in print, hide in PDF.)  But this feels unnecesarily complicated.


Is there a cross-ref building block that stands for "just use the selected text?"  Or even "don't do anything at all?"  It seems both of these solutions would allow us to just build the links using crossreferences, rather than needing to build links via two different formats?

Any help would be greatly appreciated.  Until then, we'll just be here, weeping quietly.

Thanks,

Dennis

    This topic has been closed for replies.

    3 replies

    Inspiring
    January 4, 2011

    I'd suggest a template-based approach. The good thing about it is, you use one and the same cross-reference for both print and PDF output, and you do not need conditional text, which keeps your documents robust and clean. The not so good thing is, it requires few additional clicks to switch between output formats if you use conditional text anyway.

    These are the one-time preparations:

    1 - Define cross-reference formats for one type of media, e.g. print. Don't use format-specific names (e.g. not "See heading on page nn"), as they would become confusing later on.

    2 - Create a blank document, and import the cross-reference formats from your working document using File > Import > Formats. This document is now a cross-reference formats template file for one media type. Save this template.

    3 - In the working document, change the cross-reference formats for the other type of media, e.g. clickable PDF. Use the same format names you introduced for print.

    4 - Again, create a blank document, and import the cross-reference formats from your differently formatted working document using File > Import > Formats. This document is now a cross-reference formats template file for the other media type. Save this template.

    When you've prepared the templates, you can switch back and forth between "print" and "clickable" formats like this:

    1 - Open the template that contains the desired cross-reference formats.

    2 - Import the cross-reference formats into your working document, using File > Import > Formats. Make sure to deselect all formats that you do not want to import (i.e. everything except cross-reference formats). There's a handy "Deselect all" button.

    3 - After import, you may need to update all cross-references to be displayed in the new format: Edit > Update References > All Cross-References.

    Johannes

    Participating Frequently
    January 4, 2011

    JohannesKrueger wrote:

    I'd suggest a template-based approach. The good thing about it is, you use one and the same cross-reference for both print and PDF output, and you do not need conditional text, which keeps your documents robust and clean. The not so good thing is, it requires few additional clicks to switch between output formats if you use conditional text anyway.

    These are the one-time preparations:

    1 - Define cross-reference formats for one type of media, e.g. print. Don't use format-specific names (e.g. not "See heading on page nn"), as they would become confusing later on.

    2 - Create a blank document, and import the cross-reference formats from your working document using File > Import > Formats. This document is now a cross-reference formats template file for one media type. Save this template.

    3 - In the working document, change the cross-reference formats for the other type of media, e.g. clickable PDF. Use the same format names you introduced for print.

    4 - Again, create a blank document, and import the cross-reference formats from your differently formatted working document using File > Import > Formats. This document is now a cross-reference formats template file for the other media type. Save this template.

    When you've prepared the templates, you can switch back and forth between "print" and "clickable" formats like this:

    1 - Open the template that contains the desired cross-reference formats.

    2 - Import the cross-reference formats into your working document, using File > Import > Formats. Make sure to deselect all formats that you do not want to import (i.e. everything except cross-reference formats). There's a handy "Deselect all" button.

    3 - After import, you may need to update all cross-references to be displayed in the new format: Edit > Update References > All Cross-References.

    Johannes

    Hi, Johannes:

    Good explanation of this method.

    This approach requires that all properties and settings in the imported template files to be perfectly maintained between uses, to avoid unexpected results. Because some imported properties cannot be turned off in the File > Import > Formats dialog box, absolute diligence is essential.

    A similar approach that's rarely mentioned, is the importing of MIF fragments that set only specified properties, such as cross-reference formats, and change nothing that's not specified in the fragment.

    I don't have a link to posts on this method, but perhaps others on the  forum can provide one.

    HTH

    Regards,

    Peter Gold

    KnowHow ProServices

    Participating Frequently
    January 3, 2011

    ddsbleton wrote:

    Hi gurus,

    Forgive me if this is an absurdly simple problem, but our team just isn't figuring out an elegant solution.

    What we need is two types of crossreference formats - one for print, one for PDF/the web/any other hyperlinkable medium.

    We would like the crossrefs to appear as follows:

    Print:

    [some arbitrary block of text] (see page xx)

    PDF

    [some arbitrary block of text]

    As far as we can tell, FM's crossreferences always GENERATE text based on the building blocks, whereas FM's hyperlinks allow an arbitrary chunk of selected text to serve as the "active" text.  The hyperlink behavior is what we want, in both cases.  We're not interested in pulling the name of the target paragraph, or the page number, or anything else - we just want the text we typed to serve as the link, no matter the format.

    The only solution we've been able to figure out is to actually create both a hyperlink AND a crossreference, and then conditionalize the crossreference (show in print, hide in PDF.)  But this feels unnecesarily complicated.


    Is there a cross-ref building block that stands for "just use the selected text?"  Or even "don't do anything at all?"  It seems both of these solutions would allow us to just build the links using crossreferences, rather than needing to build links via two different formats?

    Any help would be greatly appreciated.  Until then, we'll just be here, weeping quietly.

    Thank

    Dennis

    You have two purposes, so you need two kinds of references, and two distributable documents, one for each need. Because a FM cross-reference content can't be broken into pieces, say one piece that displays "some arbitrary block of text," and a piece that displays "(see page xx)," you need two cross-references. Create one cross-reference for print, and point it to the source paragraph; use it with a cross-reference format with the "<$paratext> " building block to capture the text portion of the source, add the text "(see page) " and the <$pagenum> building block. For Web, create another cross-reference to the same source paragraph with only the <$paratext> building block. Create conditions for both cross-references; a print condition, and a Web condition. In the text, apply the appropriate condition to the corresponding cross-reference. Show or hide the condition you need, and create a PDF for one purpose, then reverse the visible/hidden condition settings, and create another PDF for the other purpose.

    Because the cross-references in text are different lengths, keep a sharp eye on text reflow in the different conditionalized documents. You can use File > Utilities > Compare Documents in FM, or Acrobat's document comparison features, to check the reflow, but also use your eyes in the real text to confirm what the comparison tools tell you.

    Search Google, if necessary, for terms like "importing conditional text settings to framemaker books," without quotes, for more about managing applying conditions to multiple-file books.

    HTH

    Regards,

    Peter Gold

    KnowHow ProServices

    DebbyT01
    Known Participant
    January 3, 2011

    Forgive me if I'm oversimplifying - but it sounds to me like you want your crossreference to just be a jump to the [aribitrary block of text]?

    The xref format would look like this:

    <$paratext>

    The copy would look like this:

    aribitrary block of text

    Hope this helps!

    ddsbletonAuthor
    Participating Frequently
    January 4, 2011

    DebbyT01 wrote:

    Forgive me if I'm oversimplifying - but it sounds to me like you want your crossreference to just be a jump to the [aribitrary block of text]?

    The xref format would look like this:

    <$paratext>

    The copy would look like this:

    aribitrary block of text

    Hope this helps!

    No, I'm looking for the opposite.  I want to *type* the arbitrary block of text, have that block be clickable and jump to some arbitrary place without replacing the originally typed text with anything at all.

    <$paratext> overwrites the text I've typed with the text of the xref's destination.  I don't want to overwrite anything - I just want to go to the destination.

    Van Kurtz
    Inspiring
    January 4, 2011

    From your original post:

    Print:

    [some arbitrary block of text] (see page xx)

    PDF

    [some arbitrary block of text]

    As far as we can tell, FM's crossreferences always GENERATE text based on the building blocks, whereas FM's hyperlinks allow an arbitrary chunk of selected text to serve as the "active" text.  The hyperlink behavior is what we want, in both cases.  We're not interested in pulling the name of the target paragraph, or the page number, or anything else - we just want the text we typed to serve as the link, no matter the format.

    Other than the extra step, simply create a hyperlink for "some arbitrary block of text", which is used in BOTH versions. And then follow it with a cross-reference (see page xx) that is used ONLY in the Print version.

    As you noted in the original post, hyperlinks and cross-references are two different types of things. Maybe a case could be made that newer versions of FrameMaker should provide hyper-cross-references, which allow optional arbitrary text included in the reference AND optional display of content from the source. In your case, you would want to go further and make parts of the reference conditional.