- Paligo Documentation
- Reuse
- Filtering / Profiling
- Scoped Filtering
Scoped Filtering
Scoped filtering is a special type of filtering that's designed for this scenario:
-
You reuse the same topic in multiple places in your publication
-
You want each instance of the topic to be filtered differently, depending on its position in the publication.
For example, you might have an "installation" topic that appears in a "Windows" section of your publication and also in a "macOS" section. You want to filter out macOS content when the topic appears in the "Windows" section, and then filter out "Windows" content when the topic appears in the "macOS" section. To make this possible, you need scoped filtering.
Scoped filtering works by using the hierarchical structure of your content to define which filters to apply. You position the topic you want to use in several places so that it is always a child of another topic. Paligo uses the filters applied to the parent topic to determine which filters to apply to the child.
To use scoped filtering:
Enable Scoped Filtering
To use scoped filtering, you need to make sure it is turned on in the Layout you are going to use for publishing.
Note
For PDF output you find this setting: General / Filtering and taxonomies / Enable scoped profiling / filtering.
Note
For PDF Layouts, the option is in a different location:
-
Select General in the sidebar.
-
Select Filtering and taxonomies.
-
Look for the Enable scoped profiling/filtering setting.
-
Select Layout in the top menu.
-
Select the Layout you want to update or Create a Layout.
Tip
You can copy the URL of the Layout Editor and paste it into a new tab in your browser. This can be useful if you frequently switch between your Paligo content and the Layout settings.
-
Select Classes and attributes in the sidebar.
-
Set Enable scoped profiling/filtering to:
-
Yes to turn scoped filtering on.
-
No to turn scoped filtering off.
-
Default to inherit the value for this setting from the base Layout. The base Layout is either a built-in Layout provided by Paligo or another custom Layout, see Layout Relationships - Base, New, Duplicate.
-
-
Select Save.
Set Up Scoped Filtering
To set up scoped filtering, you need to create a publication your content arranged as parent topics and child topics. The topic you want to reuse in different places has to be a child topic. For example, in the following publication, the same "Specifications" topic is reused three times. In each case, it appears as a child of a different parent topic. You will then need to apply your choice of filter attributes and filter values to the parent topics as well as the child topic.
To show you how this is set up, we will give you step-by-step instructions. It is easier to follow with an example, so we will include one that filters based on the operating system being macOS or Windows.
Note
The instructions use filter attributes and filter values set in the Element attributes panel in each topic. But if you prefer, you could set up taxonomy filters for filters at the topic-level. You would need a taxonomy tag to represent the filter attribute (type) and child taxonomy tags to represent the filter values. For details on using taxonomy tags for filtering, see Taxonomy Filters.
We assume that you already know how to create and organize publications and topics. You should also have already enabled scoped filtering in your Layout, see Enable Scoped Filtering.
-
Create a Topic that will serve as a parent topic.
For these instructions, we will use two example parent topics: "Installing on MacOS" and "Installing on Windows".
-
Create a topic that will serve as a child topic. This is the topic that is going to be reused in more than one place in your publication.
For our example, we will use a child topic named "Operating system".
-
Create a publication and add the parent topic(s) and child topic to it. You can add the child topic many times, but it must always be a child of one of your parent topics.
-
Edit your child topic and apply filter attributes and filter values to the parts you want to filter in or out.
In our example child topic, we have two itemized lists, one for macOS content and one for Windows content. We have applied the
os
filter attribute to theitemizedlist
elements. We have set the filter value tomacOS
orWindows
respectively. -
Select Save.
-
Open one of your parent topics in the editor. Select its
section
element and use the Element attributes panel to give it:-
The same filter attribute you used on your child topic, for example, os
-
The relevant filter value for that topic.
Select Save when you have done that.
With our example, we give:
-
"Installing on macOS" - its
section
element has theos
filter attribute andmacOS
as the filter value. When we publish, we want Paligo to filter it so that it only includes the content that's relevant for macOS. -
"Installing on Windows" - its
section
element has theos
filter attribute andWindows
as the filter value. When we publish, we want Paligo to filter it so that it only includes the content that's relevant for Windows.
-
-
Repeat the previous step for your other parent topics that have the same reused child topic.
Your parent topics and child topic are now set up to use scoped filtering.
-
Publish your publication and choose your Layout. You must use a Layout that has scoped filtering enabled.
In the publishing settings, use the Profiling attributes section to include:
-
The filter attribute that you gave to your parent topics and the child topic
-
The filter values for all of the versions you want to include.
For our example, this means we choose:
-
Filter attribute:
os
-
Filter values:
macOS
andWindows
.
Note that we include all of the values that are needed for the publication. In this case, the first instance of the operating systems topic uses a macOS value and the second uses a Windows value. So we need to include both values.
Important
The parent-child relationship between topics is important for scoped filtering. When a topic appears in a publication many times, Paligo uses the filter attributes and filter values on the parent topics to figure out which filters to apply to the child topics.
-
The published output should:
-
Show the child topic multiple times in the table of contents
-
Filter the content in the child topic differently, depending on where the child topic appears.