Webhelp Responsive Fragments - Access Transformation scenario parameters

mdslup
Posts: 120
Joined: Tue Mar 06, 2018 1:34 am

Webhelp Responsive Fragments - Access Transformation scenario parameters

Post by mdslup » Wed Feb 13, 2019 1:46 am

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: 289
Joined: Mon Dec 05, 2011 6:08 pm

Re: Webhelp Responsive Fragments - Access Transformation scenario parameters

Post by ionela » Wed Feb 13, 2019 11:52 am

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: 120
Joined: Tue Mar 06, 2018 1:34 am

Re: Webhelp Responsive Fragments - Access Transformation scenario parameters

Post by mdslup » Fri Feb 15, 2019 12:27 am

Aha! Thanks.

Post Reply