Dynamic filter for Webhelp output
Post here questions and problems related to editing and publishing DITA content.
-
Sergio_7
- Posts: 16
- Joined: Fri Sep 15, 2023 9:56 am
Dynamic filter for Webhelp output
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:
Can you help me with this?
Thank you very much and best regards,
Sergio
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'
Can you help me with this?
Thank you very much and best regards,
Sergio
-
julien_lacour
- Posts: 760
- Joined: Wed Oct 16, 2019 3:47 pm
Re: Dynamic filter for Webhelp output
Post 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:
Regards,
Julien
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.
Regards,
Julien
-
Sergio_7
- Posts: 16
- Joined: Fri Sep 15, 2023 9:56 am
Re: Dynamic filter for Webhelp output
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:
EXAMPLE:
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
Thanks in advance!
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:
Code: Select all
<audience audience="it-admin">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:
Code: Select all
<audience audience="it-admin">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
Code: Select all
<audience audience="it-admin">Code: Select all
<section audience="owner">Code: Select all
<str name="audience.it-admin" js="true" php="false">IT Admin</str>You do not have the required permissions to view the files attached to this post.
-
julien_lacour
- Posts: 760
- Joined: Wed Oct 16, 2019 3:47 pm
Re: Dynamic filter for Webhelp output
Post 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
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
-
Sergio_7
- Posts: 16
- Joined: Fri Sep 15, 2023 9:56 am
Re: Dynamic filter for Webhelp output / Audience for HTML/PDF output
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:
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
-
julien_lacour
- Posts: 760
- Joined: Wed Oct 16, 2019 3:47 pm
Re: Dynamic filter for Webhelp output
Post 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:
Another variant is to customize the string directly in CSS using the :lang pseudo-class.
Regards,
Julien
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>
Regards,
Julien
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service