If an html type of KEYDEF has more than one possible values, can you configure the href attribute to match the URL?
Posted: Fri Jan 05, 2018 4:29 am
My Oxygen project has a .ditamap file that contains the reusable variables for my project. Each variable is defined as a KEYDEF value, and we use different KEYWORD values, with a condition applied, to supply the variable value for different outputs. For example:
In some cases, the KEYDEF is a placeholder for a URL that we want to select when inserting a link (DITA menu > Link > Web Link, Key option), and it has this format:
Question: Is it possible to format an "html" type KEYDEF (like the one shown above) so that both the "href" attribute and "linktext" value can vary, based on the transformation? For example, could I apply the conditional attribute "product" to the LINKTEXT element (e.g., <linktext product="product-1">) to vary the link text, and then somehow also use this same value for the "href" attribute?
Code: Select all
<keydef keys="productNameLong">
<topicmeta>
<keywords>
<keyword product="product-1">Product One</keyword>
<keyword product="product-2">Product Two</keyword>
</keywords>
</topicmeta>
</keydef>
Code: Select all
<keydef keys="pdn-ma-page" href="https://pdn.pega.com/products/pega-marketing" format="html" scope="external">
<topicmeta>
<linktext>https://pdn.pega.com/products/pega-marketing</linktext>
</topicmeta>
</keydef>