Reformatting Wiki Content Using Filters and Macros

Use

You can define filters and macros to dynamically reformat the content of comments or announcements. These are similar concepts, but filters can apply to the entire block of text, and macros operate on a specific (tagged) part of the text.

Settings and Their Effects

You can define filters and macros globally (at main space level) or for a sub-space. The system always applies global filters and macros before those defined for a sub-space. To define filters and macros for a sub-space, you can copy the global filter and macro stack and change them as required. You can enable or disable each filter or macro and change its settings.

The standard configuration for wikis includes a list of filters and macros. You can enable or disable each filter or macro and change its settings. If necessary, you can add custom filters or macros. The system always applies filters in a certain order according to their type.

Type

Description

Pre-processing filters

These filters are performed on the initial version of the content before all other macros and filters generate content. Example: HTML filter (removes unwanted tags)

Macros

Macros are only operated on the specific section of the content denoted by the macro tag. Example: Quote highlighting macro (highlights quotes that appear between tags)

Filters

Unlike macros, filters operate on the entire content. Since macros are executed first, filters do not operate on any macro content. Example: Wiki syntax filter (converts plain text using Wiki markup)

Post-processing filters

These filters are performed on the final version of the content after all other macros and filters generate content. Example: Profanity filter (replaces any words in the profanity list with asterisks (*))

Procedure

  1. From the wiki administration console, choose Start of the navigation pathSpaces Next navigation step SettingsEnd of the navigation path .

  2. In the navigation pane, choose Filters and Macros .

  3. On the header of the Filters and Macros screen, choose Change Space .

  4. To define filters and macros at the global level, select the main space; to define filters and macros for a sub-space, select the respective sub-space.

  5. If you are accessing the filters and macros setting of a sub-space for the first time, choose Copy Global Filters and then change any of the filter settings for this sub-space.

  6. Enable or disable filters and macros as required.

  7. To check or change the settings of a filter or macro, proceed as follows:

    1. In the relevant line, choose Settings .

    2. If necessary, change the settings.

    3. To leave the settings screen without making changes, choose Cancel. To save your changes, choose Save Properties.

Add a Custom Filter or Macro

  1. Make sure the new filter or macro is a valid Java class and resides in the class path of your application server.

  2. On the Filters and Macros page, scroll down to Add Custom Filter/Macro .

  3. Enter the fully-qualified class name of the filter or macro.

  4. Choose Add .

Switch from Local Settings to Global Settings

If you want to remove a local stack of filters and macros from a specific sub-space, choose Delete All Filters . The system then reapplies the global filter stack to the relevant sub-space.