# DITA Best Practices : How to Create Dynamic Profiling in Responsive WebHelp

Created by Kelly Mankenberg, last modified on Apr 13, 2017

This information is provided to assist you in transforming your WebHelp content to include Dynamic Profiling.

# Key Concepts

Dynamic Profiling requires an understanding of the following:

- Tagging DITA content with specific attribute values
- Developing a DITAVAL to allow the passing through of specific content
- Using the correct Transformation Scenario designed for Dynamic Profiling
- Working with a product team to ensure proper URL links

# What is Dynamic Profiling?

During normal transformation of content through oXygen XML Editor, we utilize Profiling Condition Sets to filter out content not intended to be in the final version of the artifact (user guide). This method requires hosting multiple version of the UG if there are multiple "flavors".

Dynamic Profiling is a method implemented by Information Development that allows all content to go to the output WebHelp - no content is filtered out. Then, when a variable is applied to the URL of the hosted content, the information is filtered accordingly. This allows for the hosting of one artifact, yet the correct content is displayed based on the link provided.

For example:

- A product team has a user manual that contains information for administrators as well as regular end users.
- They do not want the end user to be able to view information intended for administrators.
- The DITA content is tagged so that content intended for administrators has an audience attribute value of admin.
- The URL is modified: https://documentation.wolterskluwerfs.com/../../../../index.html?role=admin
- Code within the pages allows displaying only content that has a data-audience attribute with a value of admin.

# The Dynamic Profiling DITAVAL

To ensure proper filtering after transformation, the Dynamic Profiling DITAVAL requires the correct ditaval elements to be in place.

The construct of the DITAVAL consists of the following:

    <val>
        <prop action="passthrough" att="user" val=""/>
    </val>

Item | Description
--- | ---
val | The required root element of the DITAVAL file
prop | Identifies an attribute, and usually values in the attribute, to take an action on.
action | The action to be taken. The options are: include - Include the content in output. This is the default behavior unless otherwise set. exclude - Exclude the content from output (if all values in the particular attribute are excluded). passthrough - Include the content in output, and preserve the attribute value as part of the output stream for further processing by a runtime engine, for example runtime filtering based on individual user settings. flag - Include and flag the content on output (if the content has not been excluded).
att | The attribute to be acted upon.
val | The value to be acted upon.

Currently, DynamicProfiling.ditaval contains a passthrough for the following audience attributes:

<val>
<prop action="passthrough" att="product" val="paftp"/>
<prop action="passthrough" att="product" val="notpaftp"/>
<prop action="passthrough" att="product" val="product1"/>
<prop action="passthrough" att="product" val="product2"/>
<prop action="passthrough" att="audience" val="admin"/>
<prop action="passthrough" att="audience" val="user"/>
</val>

This means that when you transform your content using this DITAVAL, your content will include HTML code similar to:

<p class="p" data-audience="user">As a user of Product 2, ...</p>

<p class="p" data-audience="admin">As an administrator of Product 2, ...</p>

If you need to add another audience value, refer to Adding an Attribute Value to the Dynamic Profiling DITAVAL below.

# Procedures

The general order of procedures for implementing Dynamic Profiling within your content are as follows.

## 1. Tagging product and audience elements

For the code within the pages to filter correctly, you must have your content marked up with the proper attributes. Currently, there are two attributes used for dynamic filtering; product and audience.

1. Open your content in oXygen XML Editor.
2. Within your content, locate the elements that must be marked up; essentially, any content that is pertinent only to a particular product or audience.
3. Select the element that needs markup.
4. Add a value to the product or audience attribute.
   The following example shows a paragraph element (<p>) with the audience attribute containing a value of admin.
   Note: Currently you can use audience and product attributes.
5. Save your file before running the transformation.

## 2. Adding an Attribute Value to the Dynamic Profiling DITAVAL

1. Open the Dynamic Profiling DITAVAL into oXygen.
   The location of the DITAVAL on the Vasont server is: D:\WKFS oXygen Files\ditavals\DynamicProfiling.ditaval
2. Just before the closing val tag (</val>), enter a prop element with the correct information. You can use the following text as a template:
   For a new product: <prop action="passthrough" att="product" val=""/>
   For a new audience: <prop action="passthrough" att="audience" val=""/>
3. Verify the action attribute has a value of passthrough. This preserves and pushed the attribute value to the transformation output.
4. Verify the att attribute has a value of either product or audience, depending on your need.
5. Verify the val attribute has a value matching that in your content's product or audience values.
6. Save and close the file
7. IMPORTANT: When you save your changes, you are only changing the file on one server. Contact Todd Stupnik or Kel Mankenberg if you make changes, as the change needs to be reflected across multiple servers.

## 3. Transforming with the Dynamic Profiling scenario

Transforming your content to include Dynamic Profiling is the same as transforming to any other scenario.

1. Within oXygen: from the DITA Maps menu, select Configure Transformation Scenario(s)...
2. Select WKFS WebHelp Responsive - Dynamic Profiling.

3. Click the Apply associated button to begin the transformation.

   Note

   This scenario is pre-configured to use the DynamicProfiling DITAVAL (D:\WKFS oXygen Files\ditavals\DynamicProfiling.ditaval). If you have created your own, you will need to edit this scenario to accept your DITAVAL file.

   When the transformation is complete, your files will be ready for publishing as usual using PubAssist FTP.

## 4. Providing the correct link to the product team

In order for your hosted documents to filter content correctly, you will need to work with your product team to ensure they are providing the appropriate URL variables in the URL.

For example, if your team needs to include only content for admin users of C1, the url would ooks something like: https://documentation.wolterskluwerfs.com/../../index.html?app=C1&role=admin

Where:

URL element | Definition
--- | ---
? | a query string indicating there are field value pairs (URL variables) following
app | variable name app=C1 is the variable name and value to indicate the product for C1
& | separator for field value pairs (URL variables)
role | variable name role=admin is the variable name and value to indicate the content displayed is for a user with administrator privileges

Simply verify that the url you provide your product team contains the proper query string, as in the example above.

If you have any questions, please contact Kel Mankenberg.

# Related articles

- Page:
  Create a Top FAQs/Important Message tile
- Page:
  How to Create Dynamic Profiling in Responsive WebHelp
- Page:
  Creating a DITAVAL using oXygen locally
- Page:
  Uploading Content to Help Web Server

## Attachments:

image2017-4-13_11-0-5.png (image/png)
image2017-4-13_11-8-46.png (image/png)
image2017-4-13_11-34-50.png (image/png)
image2017-4-13_13-54-26.png (image/png)
image2017-4-13_13-55-27.png (image/png)