Page 1 of 1
Dynamic filter for Webhelp output
Posted: Fri Dec 05, 2025 1:07 pm
by Sergio_7
Dear Oxygen Team,
I would like to incorporate a dynamic filter into our HTML Webhelp output that allows users to filter between the audience groups displayed. To do this, a small dropdown menu should be displayed where different audiences are assigned so that customers can select their audience group and see the appropriate text. Upon inquiry with AI Positron, there is a possibility to activate such a filter for standard target groups ‘expert’ and ‘beginner’ as audiences by assigning:
- 'webhelp.filtering.enabled`='yes'
- `webhelp.filtering.attributes'='audience'
Unfortunatelly, I cannot find such parameters in Oxygen v28.
Can you help me with this?
Thank you very much and best regards,
Sergio
Re: Dynamic filter for Webhelp output
Posted: Mon Dec 08, 2025 1:32 pm
by julien_lacour
Hello,
Unfortunately AI Positron answer is inaccurate: there's no "webhelp.filtering" parameters available at all. Be aware that AI-based information isn't always correct.
For your use-case you can implement this flow:
- Use profiling attributes in your DITA content
- Declare the audiences in your DITAVAL file using passtrough action:
Code: Select all
<val>
<prop action="passthrough" att="audience" val="novice"/>
<prop action="passthrough" att="audience" val="expert"/>
</val>
- The audiences will appear in the output as data-audience attributes
- Create a small JavaScript adding a dropdown allowing you to select the audience filter the content.
For more information you can check
our user guide.
Regards,
Julien
Re: Dynamic filter for Webhelp output
Posted: Thu Dec 11, 2025 5:45 pm
by Sergio_7
Hello Julien,
Thank you for your prompt reply. I have found another solution without the on-the-fly filter. Now I can publish my own audience (defined in ditaval) directly under the title using a small JS script. This works well for the HTML output of Webhelp, and even the translation for different xml:langs is embedded directly in the script.
EXAMPLE:
image.png
My problem is the PDF output, which also extracts the target audience with xpath from the topic metadata and places it under the title, but the translations are not included. So the original "audience="it-admin"" value remains on that place.
EXAMPLE:
image.png
My question:
How can I manage the translations for audience="my-defined-audience" directly as a new string in the localization plugin?
I already use a localization plugin (different langs as "de-de"; "en-us" etc) for all standard strings. But these types of “strings” or “attributes” such as
or
are not part of the default "string-xx-xx" file and are not reflacted in the PDF output, even when new strings are added like
Code: Select all
<str name="audience.it-admin" js="true" php="false">IT Admin</str>
Thanks in advance!
Re: Dynamic filter for Webhelp output
Posted: Fri Dec 12, 2025 12:01 pm
by julien_lacour
Hello,
Could you confirm you are using DITA Map PDF - based on HTML5 & CSS based scenarios? How did you integrate the small JS script in the PDF output?
Does your localization plugin both requires "com.oxygenxml.pdf.css" and "com.oxygenxml.webhelp.responsive" plugins? Both need to see the plugin in order to use its strings.
Regards,
Julien
Re: Dynamic filter for Webhelp output / Audience for HTML/PDF output
Posted: Fri Dec 12, 2025 1:26 pm
by Sergio_7
Hi Julien,
1. I use my own PDF template based on HTML5 and CSS.
2. The JS is integrated for HTML output, not for PDF, as this is not possible.
3. Localization requires:
- com.oxygenxml.webhelp.localization
- com.oxygenxml.webhelp.responsive
BR
Re: Dynamic filter for Webhelp output
Posted: Fri Dec 12, 2025 1:54 pm
by julien_lacour
Hi,
I wanted to make sure you were not trying to use JS in the PDF plugin too.
For PDF output you can reuse the string from the localization plugin if you generate the element displaying the audience using XSLT, you should be able to get the variable by calling the following template:
Code: Select all
<xsl:call-template name="getVariable">
<xsl:with-param name="id" select="'audience.it-admin'"/>
</xsl:call-template>
Another variant is to customize the string directly in CSS using the
:lang pseudo-class.
Regards,
Julien