Last updated November 7, 2013. Created on January 16, 2008.
Edited by davidneedham, kiamlaluno, BettyJJ, arhip. Log in to edit this page.

Custom filter is a module that allows you to create your own filters based on regular expressions. When you need some input filter that is not available from drupal.org/project/modules, and you don't want to write your own module, you can create your own filter with this module. What you need is regular expressions, and optionally PHP programming ability.

How it works

Custom Filter module provides filters to be used in Input Formats. A filter is a collection of one or more replacement rules. A replacement rule is a find-replace mechanism that has two main parts: Pattern to tell Drupal about the pattern to be found, and replacement text to tell what text to be used as replacement. The replacement text can be a plain text or a PHP Code.

There is a change in terminology used in Custom Filter 6.x:

  • Filter was called Filter Set.
  • Replacement Rule was called Filter.

The reason behind this change is for consistency with Drupal terminology.

Getting started

  • To install this module, simply extract this module into module directory in your drupal installation (e.g. sites/all/module/customfilter).
  • Enable this module from module administration.
  • This module is available in input formats (/admin/settings/filters) under the site configuration menu (6.x-1.x-dev). This menu path might be changed in the future version.
  • Set the permissions used from this module for the roles you want to be able to create filters with this module.

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.

Comments

MaximusOfLondon’s picture

When module is enabled on D7.34 it gives warnings:

Notice: Undefined index: caption in theme_table() (line 1790 of /Library/WebServer/Documents/drupalsite/includes/theme.inc).
Notice: Undefined index: colgroups in theme_table() (line 1791 of /Library/WebServer/Documents/drupalsite/includes/theme.inc).
Notice: Undefined index: sticky in theme_table() (line 1792 of /Library/WebServer/Documents/drupalsite/includes/theme.inc).
Notice: Undefined index: empty in theme_table() (line 1793 of /Library/WebServer/Documents/drupalsite/includes/theme.inc).

Please fix that by replacing theme_table($args) with theme('table', $args) in line 1429

Thanks,
Max

jdrefahl’s picture

Just wanted to update the community that the fix supplied by MaximusOfLondon isn't going to work with D7.36. I've searched the theme.inc file looking for theme_table() on line 1429, but its not finding it there or any where else. It seems as though there has been some additions to the D7.36 theme.inc file since my error was thrown at a different line number.. But, the error was the same.

Notice: Undefined index: caption in theme_table() (line 1971 of /Users/john.drefahl/Sites/disneyDrupal/includes/theme.inc).
Notice: Undefined index: colgroups in theme_table() (line 1972 of /Users/john.drefahl/Sites/disneyDrupal/includes/theme.inc).
Notice: Undefined index: sticky in theme_table() (line 1973 of /Users/john.drefahl/Sites/disneyDrupal/includes/theme.inc).
Notice: Undefined index: empty in theme_table() (line 1974 of /Users/john.drefahl/Sites/disneyDrupal/includes/theme.inc).

So it seems like some things have changed in the most recent upgrade..

- john