Formfilter provides tools and a user interface for doing common form altering tasks. Includes a UI for selecting which fields to hide (passing the elements as values, if possible). Also includes an optional filtering of node forms to promote two fields and then put fieldsets in an 'advanced options' fieldset, to declutter the form. As of Drupal 6, Formfilter is divided into two modules: Formfilter is a pure API module and Formfilter UI provides an administrator user interface for filtering forms. Formfilter can also be used by module developers to fetch altered versions of forms.

Current Status

FormFilter is in need of new maintainers, or co-maintainers at least.
#1464384: Call for new maintainers

Given its wide use, we've kept the latest release available, but really need someone else to take over. Drupal 6 is still in high use, and there aren't any other D6 modules that provide what FormFilter does. Please consider what you can do to help save a valuable module while D6 is in LTS.

In the meantime, we will keep trying to work through the bug reports but will need help from the community to create patches and provide testing.

Drupal 7

At this time, there is no stable release for Drupal 7. An initial port is available but is unmaintained (#1165064: D7 version of Formfilter) and future development is unclear. It is an unsupported release that shouldn't be used for production sites.

Instead, have a look at Rules Forms Support or Renderable Elements.

Using Formfilter UI

Formfilter UI allows admin users with 'administer form filters' permission to hide - for each specific form - selected input fields from users who don't have the 'view forms without filtering' permission.

Admins will see, at the foot of every input form (for example the Node Edit tab), a 'Filter this form' link. Following this link brings up a version of the form with a Form Filter checkbox adjacent to each field (eg 'Hide /Title/: [x]'). Selecting a checkbox will hide that field from unauthorised users, while allowing all the unselected fields to be used normally.

Because users with 'view forms without filtering' permission see the unfiltered version of each form, there is also a link to 'Preview a filtered version of this form' that appears once some formfiltering has been applied.

Developer usage

Formfilter provides a method, formfilter_filter_form(), that can be used by developers to produce a filtered version of a form, in which designated elements are passed as values rather than shown to users. By converting elements to values, we ensure their data are retained.

To use formfilter:

  • Add formfilter as a dependency of your module.
  • Use the formfilter_filter_form() method.

formfilter_filter_form() takes three arguments:

  • $form The form to be altered.
  • $filters An array of elements to make invisible in the form, each element in turn being an array of form keys corresponding to the path of the element in the form structure. For example, to hide the element $form['comment_filter']['format'] from $form, you could call this function as follows: formfilter_filter_form($form, array(array('comment_filter', 'format')));
  • $inverse If TRUE, all elements except the ones given in $filters will become invisible. This defaults to FALSE. The following call would produce a form with only the $form['comment_filter']['format'] element: formfilter_filter_form($form, array(array('comment_filter', 'format')), TRUE);

Downloads

Recommended releases

Version Downloads Date Links
6.x-1.0 tar.gz (10.08 KB) | zip (12.09 KB) 2010-Jan-26 Notes

Development releases

Version Downloads Date Links
6.x-1.x-dev tar.gz (10.15 KB) | zip (11.95 KB) 2011-Feb-25 Notes

Project Information


Maintainers for Formfilter

  • nedjo - 22 commits
    last: 1 year ago, first: 6 years ago
  • David Lesieur - 3 commits
    last: 4 years ago, first: 4 years ago

Issues for Formfilter

To avoid duplicates, please search before submitting a new issue.
All issues
Bug reports
Statistics (2 years)
New issues
Open bugs
Participants
nobody click here