This project is not covered by Drupal’s security advisory policy.

Trims options out of CCK select boxes.

The 2.3 version for D6 works with the following field types (all select widgets):
Text
Number (integer, float, decimal)
Nodereference
Userreference
Rolereference
Content Taxonomy

This module can be used for a few different reasons:

1. You are using a reference field such as node_reference, user_reference, or role_reference and have options that you'd like to trim out of the list, but don't want to write a custom module to form alter out those options or use the views feature for populating the list.

2. You want to dynamically trim options out of a select list based on the option chosen in a parent select box, achieving a dynamic dependent dropdown effect. The difference in how this works compared to other efforts is that the select box to be trimmed must start out with all possible options, then through an admin interface you can select how these will be dynamically trimmed out based on the selected option of a different select box. With javascript disabled all options will always show but nodeapi validation will still kick in so that only valid options will be submitted.

The 2.0 branch adds a couple other use cases.

3. You have a select list which you'd like to remove values from, but you still want old nodes that had those values to appear with them. By selecting the "Persist values" checkbox on a trim you can trim out these values from new nodes but leave them as valid options if they were selected on an old node.

4. You want to trim a select box based on the role of the currently logged in user. Choose Dependent on: '-Logged in user's role' to perform these type of trims.

Administration is done by first selecting the content type which contains the field to be trimmed. You then define whether it is a dependent trim or not. For a non-dependent trim you need only select the default values. For a dependent trim you select default values (which will show regardless of selected option of parent) as well as any values to show for individual options of the parent select.

Project information

Releases