Failed using webhelp macros
Posted: Thu Jul 07, 2022 3:18 pm
Hello
I use DITA-OT 2.54, webhelp 20.1 with the build 2018042310, and the oxygen.webhelp.responsive plugin.
I have to add the following meta tag to my wt_topic.html:
It requres me to use a special variable for a topic id. I've read this article for webhelp 20.1, and found out that I can use the parameter topic-xpath that can be used to execute an XPath expression over the current topic.
I tried different parameters:
But only the last one works. Can you recommend me, please, what I should fix to be able to insert a topic_id as a varible in the meta tag?
Regards,
Nadia
I use DITA-OT 2.54, webhelp 20.1 with the build 2018042310, and the oxygen.webhelp.responsive plugin.
I have to add the following meta tag to my wt_topic.html:
Code: Select all
<link rel="canonical" href="https://example.com/topic_id" />
It requres me to use a special variable for a topic id. I've read this article for webhelp 20.1, and found out that I can use the parameter topic-xpath that can be used to execute an XPath expression over the current topic.
I tried different parameters:
Code: Select all
<link rel="canonical" href="https://example.com/${topic-xpath(/topic/@id)}" /> //(my custom one)
<link rel="canonical" href="${topic-xpath(string-join(//shortdesc//text(), ' '))}" /> // (from the example)
<link rel="canonical" href="only this command works ${oxygen-webhelp-assets-dir}" /> // (from the example)
But only the last one works. Can you recommend me, please, what I should fix to be able to insert a topic_id as a varible in the meta tag?
Regards,
Nadia