Page 1 of 1

Webhelp Responsive Fragments - Access Transformation scenario parameters

Posted: Wed Feb 13, 2019 1:46 am
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?

Re: Webhelp Responsive Fragments - Access Transformation scenario parameters

Posted: Wed Feb 13, 2019 11:52 am
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

Re: Webhelp Responsive Fragments - Access Transformation scenario parameters

Posted: Fri Feb 15, 2019 12:27 am
by mdslup
Aha! Thanks.