Webhelp Responsive Fragments - Access Transformation scenario parameters

Post here questions and problems related to editing and publishing DITA content.
mdslup
Posts: 167
Joined: Tue Mar 06, 2018 1:34 am

Webhelp Responsive Fragments - Access Transformation scenario parameters

Post by mdslup »

I was reading about how the Webhelp Responsive fragments can use web macros, here:

https://www.oxygenxml.com/doc/versions/ ... =timestamp

I'd like to put some javascript into the fragment HTML pages that has different behavior based on the "default.language" transformation scenario parameter?

I was able to access that in the past in the XSLT files using $DEFAULTLANG. How do I access that parameter in the responsive fragments?
ionela
Posts: 407
Joined: Mon Dec 05, 2011 6:08 pm

Re: Webhelp Responsive Fragments - Access Transformation scenario parameters

Post by ionela »

Hi,

You can achieve this by using the param macro. The XHTML fragment may be something like this:

Code: Select all

<script type="text/javascript" xmlns:whc="http://www.oxygenxml.com/webhelp/components"> 
var language = '<whc:macro value="${param(default.language)}"/>';
console.log("The default language is:", language);
</script>
Regards,
Ionela
Ionela Istodor
oXygen XML Editor and Author Support
mdslup
Posts: 167
Joined: Tue Mar 06, 2018 1:34 am

Re: Webhelp Responsive Fragments - Access Transformation scenario parameters

Post by mdslup »

Aha! Thanks.
Post Reply