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 Elements.
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 filter elements in a topic:
-
Mark Up Elements 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.
-
Apply Preview Filters to see how the filters will affect your content (this is an optional step).
-
Apply Publishing Filters 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.
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.
-
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.
-
In the Element Structure Menu, select the element you want to filter and then select Go to element.
-
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.
-
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.
-
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 2. 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:
-
Select the
para
element. -
Add the
xinfo:market
attribute in the Element Attributes Panel. -
Set the attribute value.
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 3. 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:
-
Select the
para
element. -
Add the
audience
attribute. -
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.
-
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.
The filter is applied to the preview applies to any content that is:
-
Not marked up to use the types of filter you have applied is included in the content.
-
Marked up to use the filters you have applied, with the same values you have set, is included in the content.
-
Marked up to use the filters you have applied, but with different values, is excluded.
Example 4. To show the market filter attribute
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 -
Marked up to use the
Market filter
attribute and a value ofEurope
The preview would exclude any content that has the Market filter
attribute and any other value, such as Asia, North America or Australasia
.
To preview the filters:
-
Select the topic or component in the Content Manager to open it in the Editor.
-
Select the Preview tab in the Toolbar.
-
Select Profile settings.
-
Select the Profiling tab.
-
Select the filter to be applied for each filter attribute for the preview.
-
Select Apply.
Paligo updates the topic to show the filters that will be used with the variant you have selected.
-
Repeat steps 4 and 5 to change the filters for the preview and see how they affect the content.
When you publish your content, you can choose which Filter Attributes to apply to the output. There is a field for each profiling attribute and you can set one or more values. Note that filter attributes are also known as profiling attributes.
If you choose a single value, Paligo will:
-
Include any content that has the filter attribute and the value you defined (for that filter attribute)
-
Include any content that does not have the filter attribute
-
Exclude any content that has the filter attribute, but with a different value.
If you choose multiple values, the filter works as an OR filter. Paligo will then filter like this:
-
Include any content that has the filter attribute and any of the values you defined (for that filter attribute)
-
Include any content that does not have the filter attribute
-
Exclude any content that has the filter attribute, but with a different value to the ones you defined.
When you apply filtering, it is important to understand the "inclusive" filter behavior we have described. Also, be aware that each filter attribute is handled separately. Choosing a value for one filter attribute does not mean Paligo automatically applies the same value for other filter attributes. The example at the end of this article shows how you can include and exclude content with filters.
To apply publishing filters:
-
Select the dotted menu (...) for the topic or publication in Content Manager.
-
Select Publish.
-
Select an Output type (PDF, HTML, HTML5, Word, XML, eLearning or SCORM).
-
Set the Languages, Variables and Optional Parameters.
Tip
These are common publishing settings, see Publish Content.
-
Select Edit in the Profiling attributes section.
-
Decide which filter attributes and values you want to apply to your publication. Then, for each filter that you want to use, select the profiling value from the menu.
To learn how to create more profiling values, see Create Profiling Values.
-
Repeat steps 5 and 6 for each profiling attribute you want to apply.
-
Select OK.
-
Select Publish document to publish your content.
Example 5. Include and exclude content using an audience filter attribute
Let's say you have a publication with these topics:
-
Install the shield app
This topic is only for IT admin users.
-
Set your preferences
This topic is suitable for all users.
-
Learning the basics
This topic is only for beginner users.
You want to publish a help center designed for IT admin users. For this, you need to include "Install the shield app" and "Set your preferences" but exclude "Learning the basics". To make this possible, you add the audience
filter attribute to the section element in the appropriate topics, and set the values as follows:
-
You give "Install the shield app" the
audience
attribute on thesection
element. You set the attribute value to:IT admin
(you add a value with this name). -
You leave "Set your preferences" with the default settings. It does not need an
audience
attribute as this content is suitable for all users. -
You give "Learning the basics" the
audience
attribute and set its value toNovice
. Again, you add a value with this name and the attribute is on thesection
element.
You then publish your content. In the publishing settings, you apply the audience
filter and you choose the IT admin
value.
When Paligo generates the output, it:
-
Includes "Install the shield app" as it has audience:IT admin. You chose to use content that has the audience filter attribute with the admin value.
-
Includes "Set your preferences" as this does not have the audience filter attribute. By default, Paligo includes any content that does not have the filter attributes you chose to use.
-
Excludes "Learning the basics" as it has the filter attribute, but it does not have admin as the value. Instead it has novice, which does not match your filter criteria, and so the content is excluded.
Comments
0 comments
Article is closed for comments.