Page 1 of 1

How to filter content for given profiling attribute

Posted: Wed Jan 06, 2021 7:07 pm
by manojdcoder
Is it possible to filter document content by one or more profiling attributes?

For example if I have content for two different country, I would like to allow user to filter content for one country, so the other one is hidden.

Re: How to filter content for given profiling attribute

Posted: Wed Jan 06, 2021 8:01 pm
by cristi_talau
Hello,

You can filter the content by specifying a DITAVAL file as an URL parameter, or by using the JS API [1].

The default behavior is to render the excluded content with low opacity. You can add a custom CSS in the Web Author UI [2] to specify a different style for elements with "oxy-filtered" class, for example to hide them. Note however that this CSS class is not API and is possible to change in a future version. However, at some point we will also offer the option to hide excluded content, so you will not have to use this class anymore.

Best,
Cristian

[1] https://www.oxygenxml.com/doc/versions/ ... e-cms.html
[2] https://www.oxygenxml.com/doc/versions/ ... 3j_p1x_3bb

Re: How to filter content for given profiling attribute

Posted: Thu Jan 07, 2021 1:46 am
by manojdcoder
Lets say we have an editor action in the toolbar using which user can pick the attributes he wants to show / hide.
Is it possible to pass the DITAVAL content as parameters instead of file url? Would you suggest implementing a servlet that would return the DITAVAL content?

Re: How to filter content for given profiling attribute

Posted: Thu Jan 07, 2021 3:50 pm
by mihaela
Hello,

There is no parameter available to provide the DITAVAL content, you can only provide the URL of a DITAVAL file. The solution you suggested seems right.

Best regards,
Mihaela

Re: How to filter content for given profiling attribute

Posted: Thu Jan 07, 2021 6:02 pm
by manojdcoder
Thank you mihael.

Does Oxygen have something similar for DocBook, filter by profile attributes?

Re: How to filter content for given profiling attribute

Posted: Fri Jan 08, 2021 3:24 pm
by mihaela
Hi,

There is no URL parameter similar with ditaval for DocBook, but you can implement that functionality using the current API: you can set a pseudo pseudo-class on the root XML element describing which are the attribute values to be searched to show or hide elements using CSS. Here is a forum post that explain how you can do this (the post contains a DITA sample, but it is similar for DocBook):
topic14410.html#p42512
This approach is suitable for the case when you want to dynamically change the profiling information.

If you need to impose the initial profiling conditions you can use the following API added on 23.0 that alloows you to set various pseudo classes to elements before the content is presented visually:
https://www.oxygenxml.com/InstData/Edit ... essor.html

Best Regards,
Mihaela