DITA and XMetaL Discussion

  • linjinwei

    Reuseable Component

    Participants 4
    Replies 5
    Last Activity 12 years, 6 months ago

    Can anybody explain to me what is a reuseable component and how do I make use of it? Examples will be great.

    Thanks

    Reply

    mag3737

    Reply to: Reuseable Component

    XMetaL's Reusable Components are a special case of the DITA “conref” mechanism for reusing content.

    A conref is an attribute that forms a particular kind of link in a DITA document.  This link is essentially like a URL that points to another element in a DITA document (usually another one, but doesn't have to be).  More importantly, the meaning of this link is when this document is published to an output format, go get that other thing and put it in here.  The thing being referenced must be of a compatible type for the location where the link is made.  For your convenience, XMetaL also displays the referenced content in place while you are editing.

    Conrefs can point to things anywhere in any DITA documents, but many users prefer to save one's reusable components (the targets of the links) one-per-document.  This has certain advantages with regards to storing content in a CMS, for example.

    XMetaL's Reusable Components gives you some special-purpose commands that let you do just that:  “Create Reusable Component” will take a bit of content that you have selected in your current document, and save it out into a separate file (which is a standard, specialized DITA topic) for later reuse.  “Insert Reusable Component” allows you to select one of these saved components and form a link to it.

    Reply

    Bill H

    Reply to: Reuseable Component

    Here's a simplistic explanation: You define some text in one file. Then you point to that one file anywhere else you want to use that text. So if that file says YUCK, anywhere you point to it (via a conref) you'll see YUCK. If suddenly every YUCK needs to be YUM instead, you just make the change in the “definition” file. Then the new definition will be “read” wherever it's referred to.

    The XMetaL User Guide explains how you Create a reusable component (the “definition” file) and then Insert reusable component–i.e., point to the definition file.

    Two examples of how we use reusable components:

    1. Product names. If our company decided to change HN9000 to HN9999, we'd only have to make the change in a single file.

    2. Document titles. We store the names and document numbers of other documents we refer to in reusable component files. This makes it easy to refer to a document, always get the document title and number right, and easily make a correction globally if necessary (if we don't get it right!).

    Reply

    lorenma

    Reply to: Reuseable Component

    Yes, the manual says the following:

    1. Select the content you want to make into the re-usable component. If the content spans more than one paragraph-level element, repeat these steps for each of the elements.
    2. Click Reuse > Create Reusable Component .

    As “Reuse” is not a menu element, where would one find this element in the XMetaL Author DITA Edition structure?

    Reply

    Su-Laine Yeo

    Reply to: Reuseable Component

    Hi Lorenma. What version of XMetaL are you using?

    If you have a DITA topic open, there is a “Reuse” menu in XMetaL Author Enterprise 5.1 and 5.5. It wasn't there in previous versions.

    Reply

    lorenma

    Reply to: Reuseable Component

    Thank you, Su-Laine.

    I am using 5.0; we have 5.1 but because of an incompatability with one of our tools, we needed to drop back a version. I will discuss this with our internal engineers to see what steps we can take to resolve.

    Best,

    Loren MacGregor

    Reply

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

Lost Your Password?

Products
Downloads
Support