If an html type of KEYDEF has more than one possible values, can you configure the href attribute to match the URL?
Post here questions and problems related to editing and publishing DITA content.
If an html type of KEYDEF has more than one possible values, can you configure the href attribute to match the URL?
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>
Re: If an html type of KEYDEF has more than one possible values, can you configure the href attribute to match the URL?
Hi,
You could try something like:
or redefine completely the key:
Regards,
Radu
You could try something like:
Code: Select all
<linktext><ph product="prod1">https://pdn.pega.com/products/pega-marketing2</ph><ph product="prod2">https://pdn.pega.com/products/pega-marketing2</ph></linktext>
Code: Select all
<keydef keys="pdn-ma-page" href="https://pdn.pega.com/products/pega-marketing"
format="html" scope="external" product="product1">
<topicmeta>
<linktext>https://pdn.pega.com/products/pega-marketing</linktext>
</topicmeta>
</keydef>
<keydef keys="pdn-ma-page" href="https://pdn.pega.com/products/pega-marketing2"
format="html" scope="external" product="product2">
<topicmeta>
<linktext>https://pdn.pega.com/products/pega-marketing2</linktext>
</topicmeta>
</keydef>
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service