Page 1 of 1
Formatting text in keyword element
Posted: Thu Oct 24, 2019 2:20 pm
by THaen
Hi,
For a specific customer, we are using keys to manage the product names. However, some of those product names contain one or two words that have to be in italics. It is not possible to use the <i> element in a <keyword> element. Does someone have a solution to this?
Any hints would be much appreciated.
Thanks
Re: Formatting text in keyword element
Posted: Fri Oct 25, 2019 8:00 am
by Radu
Hi,
Using keyrefs you can only reuse plain pieces of text. If you want to reuse text with various inline elements you will need to use conkeyrefs. Usually with conkeyrefs you have a DITA topic containing reusable elements, which with an id attribute defined on it. You create a <keydef> in the DITA Map pointing to the topic and then refer to the reusable content something like
<ph conkeyref="keyName/elementID"/>.
https://www.oxygenxml.com/doc/versions/ ... eyref.html
Regards,
Radu
Re: Formatting text in keyword element
Posted: Fri Oct 25, 2019 11:03 am
by THaen
Hi Radu,
Thank you for your answer, I was thinking in that direction, but didn't really know how exactly. I'm going to try it right now. Thanks!
Tessa
Re: Formatting text in keyword element
Posted: Fri Oct 25, 2019 12:21 pm
by THaen
Hi Radu,
That worked for me in body text.
However, what if we need that same product name in the metadata (<prodname>), to generate output that uses the metadata to put the productname in the header on each page of the document? I cannot insert that conkeyref there, because the <ph> element is not valid there. Do you have any tips for that circumstance?
Regards,
Tessa
Re: Formatting text in keyword element
Posted: Fri Oct 25, 2019 3:40 pm
by Radu
Hi Tessa,
You will probably need to define an extra reusable <keyword> holding the same product name but without styling and refer to it using keyref.
You will get indeed the same product name definition duplicate, once as a reusable ph and once as a keyword.
Regards,
Radu
Re: Formatting text in keyword element
Posted: Mon Nov 04, 2019 1:20 pm
by THaen
Hi Radu,
Thank you for your reply.
Does that mean that it is not possible to use text formatting in the <prodname> element?
Regards,
Tessa
Re: Formatting text in keyword element
Posted: Tue Nov 05, 2019 12:51 am
by Radu
Hi Tessa,
The DITA 1.3 specs lists the possible child elements of <prodname>:
https://www.oxygenxml.com/dita/1.3/spec ... __prodname
and they are all you can use. The <prodname> element is intended as metadata, so it was not considered as something which appears in the published output.
Regards,
Radu