Skip to main content

XTM Connect – Adobe Experience Manager

Configuring preview filters for Visual mode

A problem can occur in Visual mode if a source content page contains in-line references to files that should not be sent to XTM Cloud with that source content page, and used for generating a preview. Sometimes, It is also necessary to be prevent certain types of source content file from being sent to XTM Cloud for translation.

Example

A source content page contains a reference to a nested REACT application that relies on dynamic data pulled from a REST API. This prevents the preview from being displayed. In such a case, you might need to filter out the scripts that break the page rendering.

Excluding unwanted file types or files

To resolve problems of this kind, you can define filters to exclude specific file types, or files in specific locations, so they are not sent to XTM Cloud with or as translatable content. To do so, use regular expressions (also known as "regex").

To configure preview filters for Visual mode:
  1. On your localhost, in your instance of Adobe Experience Manager, open the OSGi Console.

  2. Select Configuration Manager. The Configuration Manager is displayed in the Configuration tab screen.

  3. Find the XTM Preview Configuration section and select it, to edit the configuration values in it. You can make two different sets of settings, described in the table below:

    • Reference filters: filter in-line references to other files, in source content files, to ensure that only relevant reference files are sent to XTM Cloud. See the Reference filter Preview filter type below.

    • Custom HTML reference patterns: use these to define custom regular expressions that extend a preview package by including additional assets. You can specify asset types and locations to be included. See the Custom HTML reference pattern Preview filter type below.

Preview filter settings

Make these settings, if required:

Preview filter type

Entry field

Description

Examples

Reference filter

Reference filters

  1. In the Reference filters field, enter the required regular expressions.

    If you enter more than one regular expression, separate them with a blank space.

    They will be used to filter in-line references to other files, in source content files, and ensure that only relevant reference files are sent to XTM Cloud. You can exclude these files by type and/or location.

  2. Select Save.

    Result: any preview filter regular expressions you have entered are saved and will now be applied whenever Translation requesters send source content pages to XTM Cloud, for translation. When they do so, a preview package containing only relevant reference files is generated and sent with the appropriate source content pages.

Reference filter examples
  • To exclude all reference files located in a folder called /c-etc/, use the regular expression .+\/c-etc\/.+. Note that this deliberately has a full stop at the start, but does not end with a full stop.

  • To exclude all JavaScript files, no matter where they are located, use the regular expression +\.js. This regular expression uses the file extension (.js) to identify JavaScript files.

Custom HTML reference pattern

Custom HTML reference patterns

  1. In the Custom HTML reference patterns field, enter the required regular expressions.

    If you enter more than one regular expression, separate them with a blank space.

    They will be used to filter source content files and ensure that only the relevant source content files are sent to XTM Cloud. You can include these files by type and/or location.

  2. Select Save.

    Result: any custom HTML reference pattern regular expressions you have entered are saved and will now be applied whenever Translation requesters send source content pages to XTM Cloud, for translation. When they do so, a project package containing only the relevant source files is generated and sent to XTM Cloud.

Custom HTML reference pattern filter example

  • To include graphic files with a particular format, located in the jcr_content folder, use the regular expression jcr_content/.+?\.(jpeg|jpg|png).

    Note how the graphic file extensions have been listed alphabetically and then separated by a pipe character (|).

Warning

If you define an invalid regular expression, it will not be taken into account. For trouble-shooting, you will find a WARN message about it in the logs.

Note

For details of other Visual mode-related topics, see Configuring Visual mode.