Filtering / Profiling
Learn how to use filtering, also known as profiling, to control which content is included in your outputs. Find out what you can filter and how the filtering works.
Filtering is also known as "profiling" or "conditional content" and you can use it to include or exclude content depending on certain conditions. For example, you can set a topic to be included in your publication if the intended audience is beginners, but excluded if the audience is experts.
You can use filtering to include or exclude:
-
Entire topics in a publication
-
Elements in a topic, such as paragraphs, procedures, or steps in a list.
Filtering gives you more control over your content and can also give you more opportunities for your topics. Let's say that you have a topic that could be reused, if only it did not contain a particular paragraph. By filtering that paragraph, you can make the topic suitable for reuse, as you can include or exclude the paragraph when needed.
Paligo has several different types of filtering, but to begin with, we recommend you learn about "regular" filtering.
The workflow for "regular" filtering is:
-
You mark up the content that you want to filter. This tells Paligo what content can be filtered, and what conditions apply.
To set the conditions, you choose a type of filtering to apply and you set a filter value.
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.
For example, to filter a paragraph so that it only appears in a user guide for a Windows version of a product, you could set a filter attribute of
os
(operating system) and a filter value of Windows. -
You set the filters you want Paligo to apply to the published output.
-
Paligo then:
-
Includes all of the content that does not use the filters attributes you chose for publishing.
-
Searches through your content to find any elements that have the filter attribute(s) that you set for the publication. For example, if you set an
os
filter attribute in the publication, Paligo will find all of the elements that are marked up to have anos
filter attribute. These are the "matching" elements. -
Searches through the "matching" elements to check the filter values. Those with the same value that you set for the publication are included in the published output. Those that have different values are excluded.
Tip
If you want to exclude content, create filter values for the conditions where it should be included and also for where it should be excluded. For examples, see Mark Up Elements for Filtering and Mark Up Topics for Filtering.
-
Note
The process for setting up filtering is different for scoped filtering, taxonomy filtering, and filtering by language.
There are several ways of applying filters to your content in Paligo. They all involve marking up your content for filtering and then setting filters on the publication. But the process for doing this is different depending on which method of filtering you choose to use.
The two main types of filtering are:
-
"Regular" filtering, where you edit a topic and apply a filter attribute and filter value to one or more elements. You can use "regular" filtering for filtering entire topics or individual elements in a topic.
To get started with "regular" filtering, see:
-
Taxonomy filtering, where you set up taxonomy tags to represent the filter attributes and values, and you drag and drop them on to your topics. You can also set Paligo to use the taxonomy hierarchy for more complex filters, where Paligo uses the taxonomy hierarchy to determine which topics to include or exclude.
See taxonomy filtering for more details.
There is also scoped filtering. This is for when you want to use the same content in the same publication, but apply different filters depending on where the content appears.
You can use a mix of the different filtering types, if needed.
When you set a filter in Paligo, there are many different types of filter you can use. Some are defined by the DocBook standard and some are custom filters that we have created for Paligo.
The following table shows the filters you can use:
Filter attribute |
Source |
Description |
---|---|---|
arch |
DocBook |
Filter by computer or chip architecture. |
audience |
DocBook |
Filter the content based on the intended users, for example, internal staff or customers. You could use audience for the knowledge level too, such as beginner or expert. But there is a |
condition |
DocBook |
This is a general purpose filter attribute. Use this filter if the other filters do not meet your requirements. |
conformance |
DocBook |
Filter by conformance standards. |
os |
DocBook |
Filter by operating system, for example, Windows. |
revision |
DocBook |
Filter by publication revision, for example, v.3.1. |
security |
DocBook |
Filter by security level, for example, Low. |
userlevel |
DocBook |
Filter by knowledge level of the intended audience, for example, expert. |
vendor |
DocBook |
Filter by product provider, such as a manufacturer or seller. |
outputformat |
DocBook |
Filter by the type of output, for example PDF. |
xinfo:product |
Paligo |
Filter by product name or model. |
xinfo:country |
Paligo |
Filter by the country that the documentation is designed for, for example, USA. |
xinfo:market |
Paligo |
This is similar to xinfo:country except that it is less geographically rigid, for example, you can filter for the Asia market or the North America market. |
xinfo:version |
Paligo |
Filter by version. You can use this in combination with the version management features of Paligo, but this is not a requirement. The usage is up to you. |
xinfo:proglang |
Paligo |
Filter by programming language or to publish to API style "on-the-fly" filtering HTML5. NotePaligo does not support using |
xml:lang |
DocBook |
Filter by natural language, for example, filter Swedish content. This filter attribute is a special case, as there is a different process for using language filters. To find out more, see Filter by Language. |
To find out how to use filters in your content, see Filter Block Elements in a Topic , Filter Topics in a Publication, and Filter by Language.
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:
-
Find the topic that contains the filters in the Content Manager, and open it in the editor.
-
Select Preview > Profile settings.
-
Select Profiling.
-
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.
-
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.
-
-
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.
You can use the xml:lang
attribute to filter content by (natural) language for HTML and PDF outputs. This means you can mark an element as being appropriate for a language, and the element will only be included if the content is published to that language. If you publish to different
languages, the element is excluded.
The xml:lang
attribute works a little differently to the other filter attributes. Firstly, to use it, you need to enable the feature on the layout that you will use for publishing. Then you can add it to elements that you want to filter, and finally, you publish and choose what
languages to publish to. Paligo applies the language filters automatically, based on what languages you are publishing to.
-
Select Layout and edit the layout you are going to use for publishing.
-
Enable the Use xml:lang as profiling attribute setting. This is in the Classes and Attributes settings for HTML layouts and in the General > Filtering and Taxonomies section for PDF layouts.
-
In your content, select an element that you want to filter by language.
-
Use the Element attributes section to add the
xml:lang
filter attribute and set its value to the appropriate language. For the language values, use the two letter language codes, for example, en for English, sv for Swedish.Important
Use the two letter codes shown in the Languages section (see step 6). Only these two letter codes are supported. You cannot use alternative language codes.
-
Repeat steps 3 and 4 for other any other elements you want to filter by language.
-
Publish your content and choose the layout you edited in step 1 and the language(s) that you want to publish to:
If you publish to a language that matches the value of the
xml:lang
filtered content, that content is included in the output.If you publish to a language that does not match the value of the
xml:lang
filtered content, that content is excluded from the output. -
Set any variables and other profiles as required, and then publish.
You can use the phrase
element to apply filters to inline content. This is useful when you need to filter part of a block element, for example, if you wanted to filter one sentence in a paragraph rather than the entire paragraph.
To filter inline content:
-
Select the content you want to filter.
-
To display the element context menu, press Alt and Enter (Windows) or Option ⌥ and Enter (Mac).
-
Add the
phrase
element.Paligo inserts your selected content into the
phrase
element. -
Click in your selected content so that the
phrase
element is shown in the Element Structure Menu. -
In the Element attributes section, add the filter condition that you want to apply to the phrase. This works in the same way as filtering any other element, for example, you could set an xinfo:country attribute if you wanted to be able to include/exclude the phrase based on the country.
To find out about filter types, see Filter Attributes.
-
Set the value for the filter and apply it to your
phrase
element.To find out about filter values, see Filter Block Elements in a Topic.
-
Select Save.
When you publish, you can choose which filters to apply to your content. As the inline content is now wrapped in a phrase
element, it can be filtered in the same way as any other element. The settings you choose when you publish will determine whether the phrase
is included or excluded from the published content.