Filter Block Elements in a Topic

In this section, you can learn how to apply filters to block elements, such as paragraphs, lists, and images. These filters apply to an entire block of content. If you want to filter inline content, such as one sentence or one word in a paragraph, see Filter Inline Content.

Filtering block elements is useful when you have entire elements that you want to include or exclude, depending on certain criteria. For example, you could have a paragraph that is only relevant to Mac users, so you could add a filter to include or exclude it, depending on whether the publication is for Windows or Mac.

Note

To apply filters to elements in a topic, use the "regular" type of filtering (you cannot use taxonomy filters for filtering elements in a topic).

To learn how to set up filters on block elements, watch the video or read the following sections. The video shows a list item being filtered, and you can use the same technique to filter other block elements.

To filter elements in a topic:

1. Mark up your content for filtering. For filtering elements in a topic, use the "regular" type of filtering. You cannot use taxonomy filters for filtering elements in a topic.

2. Preview your content to see how the filters will affect your content (this is an optional step).

3. Set the filters that you want your publication to use and then publish.

Before you can apply filtering to your publications, you need to tell Paligo what elements can be filtered, and what filter conditions apply. You can do this by "marking up" the elements that you want to filter.

To mark up your content, you can select an element and then apply a filter attribute and a filter value. The filter attribute tells Paligo which type of filter to use, and the filter value sets the condition for the filter.

Element (1), filter attribute (2), filter value (3).

Paligo does not have one generic filter for everything. Instead, it has a range of filter types, called filter attributes. There are different filter attributes for filtering by product name, by audience, by country, and by market, among others.

Note

Marking up the content tells Paligo what content can be filtered. It does not apply the filter. You apply the filter in the publishing settings when you publish the content.

1. Edit the topic that contains the element you want to filter. Select any part of the element so that it is shown in the Element Structure Menu.

2. In the Element Structure Menu, select the element you want to filter and then select Go to element.

Tip

If you want to filter text inside a paragraph, and not the entire paragraph, highlight the text and add the phrase element to it. You will then be able to apply the filter attribute and value to the phrase element so that it can be included/excluded when you publish.

3. In the Element attributes section, select Add attribute and search for the filter attribute you want to use. Note that the Add attribute list includes all attributes, not just filters

There are many different types of profile attribute (filter) that you can use, including product name, country, and audience. To find out about the different profile attributes, see Filter Attributes.

4. Use the Profiling values dialog to set the filter value. Think of setting the value as a way of telling Paligo where the content is applicable.

For example, if you have a paragraph that is only applicable to a product named "ACME 1050", you could give it the xinfo:product filter attribute and set the filter value to ACME 1050.

You can have single values or you can add multiple values, where Paligo will include the content if either of the values are a match.

Choose from any of the available values or use Add value to create more values if needed.

Note

We have included some more detailed examples of how you can use filter conditions to include and exclude content at the end of this section.

5. Repeat steps 2-4 inclusive to apply filters to as many elements as needed.

You have now set the profile attributes and values for the content you want to filter. We recommend that you preview the filters to see how they work before you publish.

Example 1. Use multiple filter values to create an OR filter

Let's say you have a paragraph that is only applicable for customers in North America and the EU. You want to include the paragraph when you are publishing to those markets, but want to exclude it when you are publishing to the Middle East, Australia, and other markets. This is where you need an OR filter, as you want the content to appear when the market is North America OR the EU.

To mark up the paragraph, you:

1. Select the para element.

2. Add the xinfo:market attribute

3. Set the attribute value. As the content applies to two markets, you have to set two values: North America and EU. Another option would be to create another filter that represents North America and the EU combined, but this could be cumbersome in this case.

When you publish the content, you can choose the filters for the publication.

• If you set the publication's market filter to North America, EU, or both North America and EU, the filtered paragraph is included.

• If you set the publication's market filter to another region, such as Australia, the filtered paragraph is excluded.

• If you do not set a market filter for the publication, the filtered paragraph is included. It is only excluded from the publication if the market filter is applied and the value for the market filter does not match North America or EU.

Example 2. Exclude a filter value rather than include it

Paligo's filtering is inclusive, which means that when you set a filter, you are telling Paligo what content you want to be included in the output. But there may be times where you want to exclude certain content rather than include it. For these situations, set up filter values for:

• The conditions where you want the content to be included

• The conditions where you want the content to be excluded.

Then, when you publish, you can tell Paligo which content to include. By including one condition, you automatically exclude the other possible conditions.

Note

The "inclusive" filtering strategy may take a while to wrap your head around if you are new to filtering or if you come from another environment where you used filters for both including and excluding specifically. But once you get the idea, the inclusive strategy is very powerful in that it can accomplish exactly the same, but with a much cleaner structure, so you will have a more robust long-term solution.

Let's say you have three types of users: administrators, engineers, and operators. You have a paragraph that you want to be included for the engineers and operators, but excluded for the administrators. To set this up you:

1. Select the para element.

2. Add the audience attribute.

3. Select the value for the audience attribute and create these values: "administrators", "engineers", "operators".

Note that it is important to create values for where you want the content to be included and also for where you want it to be excluded.

4. Set the audience attribute value to "engineers" and "operators".

When you publish the content, you can choose the filters for the publication.

To publish for the administrator audience, you set the audience to "administrators".

The published output will then include:

• Any content that has an audience filter with a value of "administrators". The paragraph that you marked up has an audience filter with a value of "engineers" and "operators", and so it is not included in the published output.

• All content that does not have an audience filter

To publish for the engineers or operators, you set the publication's audience filter to "Engineers" and "Operators".

The published output will then include:

• Any content that has an audience filter with a value of "Engineers" or "Operators". So the paragraph that you marked up is included in the published output.

• All content that does not have an audience filter.

When you mark up your content for filtering, you can use the preview feature to see the effects of the filters. This is a good way of making sure that the filters work as expected, and is especially useful if you have used a combination of filters.

To preview the filters:

1. Find the topic that contains the filters in the Content Manager, and open it in the editor.

2. Select Preview > Profile settings.

3. Select Profiling.

4. For each filter attribute, select the field and choose the filter you want to apply for the preview. If you do not want to apply a particular filter, leave its field blank.

5. Select Apply.

The filter is applied to the preview of the topic:

• Any content that is not marked up to use the types of filter you have applied is included in the content.

• Any content that is marked up to use the filters you have applied, with the same values you have set, is included in the content.

• Any content that is marked up to use the filters you have applied, but with different values, is excluded.

For example, if you set the preview to show the Market filter attribute with a value of Europe, the topic would show:

• Any content that is not marked up to use the Market filter attribute

• Any content that is marked up to use the Market filter attribute and a value of Europe

The preview would exclude any content that has the Market filter attribute and any other value, such as Asia, North America, Australasia, etc.

6. Repeat steps 4 and 5 to change the filters for the preview and see how they affect the content.

To stop applying the filter preview, display the Profile settings dialog select the Profiling tab, and then select Reset.

When you publish your content, you can choose which filters to apply to the published output (HTML5 help center, PDF, etc.).

1. In the Content Manager, find the topic or publication that you want to publish. Select its options menu ( ... ) and select Publish.

2. On the Publish document dialog, select an output type (PDF, HTML5, etc.), and set the Languages, Variables, and Optional Parameters.

These are common publishing settings. To find out more, see Publishing Process.

3. Select the Edit option in the Profiling attributes section. Paligo displays the Profiling attributes dialog.

The Profiling attributes dialog contains a list of the filter attributes that you can use. There is a field for each attribute.

4. Select the field for a filter attribute that you want to apply to your publication. A drop-down list of the available values appears. These are the values that have been created for the filter when the content was marked up for filtering.

Choose the value that you want to apply.

You would normally just choose one value for each filter attribute, the variant that you want to publish at the moment. This is usually the recommended strategy. It's possible to choose multiple values for a filter, however. The filter then works as an OR filter, where Paligo will filter topics that contain any of the values you set (value 1 or value 2 or value 3, etc.).

Tip

When you choose filters, you are telling Paligo which content to include in the published output. But sometimes, you may want to exclude content rather than include it. For example, you might want to publish content for all audience types except administrators. To do this, you need to mark up the content so that:

• The content you want to include has a condition (filter attribute) and a value

• The content you want to exclude has the same condition as those that you want to include. But set a different value for the topics you want to exclude.

When you publish, you choose which condition value to include. Paligo will then:

• Include any content that has the matching condition and value

• Include any content that does not use the matching condition

• Exclude any content that uses the matching condition, but has a different value.

5. Repeat step 4 for each attribute and value that you want to apply and then select OK.

Note

Only set a value for those filter attributes that you want to apply to your publication. For any attributes that you do not want to use, leave their fields blank. When there is no attribute set, Paligo ignores that type of filter.

6. Select Publish document to publish your content.