DITA and XMetaL Discussion

XMetaL Community Forum DITA and XMetaL Discussion Creating a conditional inside a conref

  • sgrayson

    Creating a conditional inside a conref

    Participants 4
    Replies 5
    Last Activity 11 years, 3 months ago

    I've searched through the DITA documentation but can't find the answer. I'm using XMetal Author Enterprise 6.0.
    I would like to be able to use a conref for a phrase but be able to insert content into that phrase. For example, I would like to conref this sentence and have the datatype name be a variable I can insert into the conref:
    See the [datatype name] datatype for more information.

    Creating the conref for the sentence is easy; I just don't know how to add one of the many datatype names each time I use the sentence without creating two conrefs, one on each side of the datatype name. Any ideas?

    Thanks,
    Steve

    Reply

    Derek Read

    Reply to: Creating a conditional inside a conref

    Most likely what you are looking for is what our documentation refers to as “conditional text”. Can you have a look at that and see if it sounds like what you want?

    Reply

    sgrayson

    Reply to: Creating a conditional inside a conref

    No, that's not quite it I believe. What I would like is more of something like this:

    The conref:The [parameter] API section provides
    the necessary response.

    UsageThe Product API section provides the necessary response.
    ORThe Order API section provides the necessary response.

    Reply

    Derek Read

    Reply to: Creating a conditional inside a conref

    Conditional text will do this for you. You just need to decide which conditional text attribute makes the most sense for your usage. My first instinct would be to use @product, but that is really intended to produce different outputs for similar but different products.

    In your case you could use any of the standard ones, including @otherprops. See the DITA Language Reference topic

    Here's your DITA rewritten to use the otherprops conditional text attribute:

    The Product Order API section provides the necessary response.

    Then when you produce your output you would create a ditaval file that says “include” @otherprops=”product” and “exclude @otherprops=”order” (or the opposite, or both, or neither). XMetaL can be configured so that it will display a dialog for you to pick from and will then automatically generate the ditaval file for you based on your choices.

    If you configure XMetaL's conditional text feature you can then set conditional text values and generate output based on them by selecting radio buttons in dialogs:

    1) You can use the first two items on the Reuse menu to:
      a) Set conditional text value(s) for the current element.
      b) Style contional text so that the background of different elements with different conditional text values appear with colours of your choosing.

    2) When you generate output you can select the button labelled Show/Hide Conditional Text to change your output based on these values and have XMetaL automatically generate the right ditaval file settings for you.

    See these help topics:
    Conditional text
     Creating and modifying conditions
     Apply a condition
     Show conditional text in previews and output
     Style conditional text

    Reply

    sgrayson

    Reply to: Creating a conditional inside a conref

    Sorry, Derek, I don't seem to be explaining myself. I want to use the conref multiple times in a document, and have a parameter I provide in each use inserted as the variable in the conref. We have to use lots of conrefs where the only change is one word, and I was looking for a solution where I didn't have to create a conref on each side of a word. I was looking to make the word the variable inside a single conref.

    Thanks,
    Steve

    Reply

    Derek Read

    Reply to: Creating a conditional inside a conref

    Sounds to me like what you want just doesn't exist in DITA 1.1. I think the closest you can get is to use conditional text as I have described here.

    Perhaps what you really wish to have might be solved using DITA 1.2 and its keyref, keydef, keyword elements and the notion of “key spaces”.

    Reply

  • You must be logged in to reply to this topic.

Lost Your Password?

Products
Downloads
Support