Failed using webhelp macros

Post here questions and problems related to editing and publishing DITA content.
Nadia
Posts: 3
Joined: Wed Jun 22, 2022 10:29 am

Failed using webhelp macros

Post by Nadia »

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:

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
image.png
image.png (108.58 KiB) Viewed 472 times
alin
Site Admin
Posts: 268
Joined: Thu Dec 24, 2009 11:21 am

Re: Failed using webhelp macros

Post by alin »

Hello,

I have tested your example with WebHelp 20.1 and the macros were expanded correctly for all three <link> elements.
Image

Regards,
Alin
Alin Balasa
Software Developer
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply