Re: profile problems


Aaron Mehl
 

Thanks,
Tomorrow I will give this a whirl,
Aaron

On Tuesday, January 5, 2021, 09:02:11 PM EST, Leigh White <lwwhite5@...> wrote:


Hi Aaron,

I would recommend doing this with keys rather than with conditional profiling. You don't have to maintain two pieces of alternating information in your topics. It's also likely that your number of conditions will grow over time and these get more and more difficult to maintain.

Using keys, you would set your keywords up like this (for example)

<title>Creating a <keyword keyref="account-type"/> Account</title>
    <shortdesc>A <keyword keyref="account-type"/> account in KMyMoney contains the same information as the same account in
        your bank.</shortdesc>

and so on. The <keyword> elements here refer to a key, or variable, that has no definition on its own. You must now define it just as you would define any variable. You must define the key in the map that references this topic. For example:

<map>
    <title>Aaron's Map</title>
    <topicref href="creating-an-account.dita"/>
    <keydef keys="account-type">
        <topicmeta>
             <keywords>

                  <keyword>Checking</keyword>

             </keywords>
       </topicmeta>
   </keydef>
</map>

When you generate a PDF or XHTML or whatever output for this map, the word "Checking" will replace all the keyword elements that refer to the "account-type" key. When you want to generate output that mentions a savings account, you simply change the "account-type" key definition in the map (not in the topic; the topic always references the same variable):

<keydef keys="account-type">
    <topicmeta>
        <keywords>
            <keyword>Savings</keyword>
        </keywords>
    </topicmeta>
</keydef>

Then generate your outputs and the word "Savings" will now replace all the keyword elements that refer to the "account-type" key.

You can create as many keys as you have need to alternate words or phrases. You can use keys to alternate between images as well. For this use case, the syntax of the keydef is different but the idea is the same.

There is a ton of documentation about keys online. Just Google "DITA keys" and you'll find plenty of examples and use cases to get you started.

Best,
Leigh

Join main@dita-users.groups.io to automatically receive all group messages.