Filter by Language
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.
Tip
Use a semi-colon to separate multiple filter values, see Add Multiple Values to an Attribute.
-
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 for HTML layouts OR General > Filtering and Taxonomies for PDF layouts.
-
Select Enable for Use xml:lang as profiling attribute.
-
In your content, select an element that you want to filter by language.
-
Use the Element Attributes Panel 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 andsv
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.