Allow a vocabulary to be required for some content types, optional for others, and disallowed for the rest.

Example:
Assume a forum configured to include multiple content types: forum- and story-type nodes. A forum-type node must have at least one term from the "Forums" vocabulary. But why should a story-type node be restricted to the forums?

The configuration UI at 'admin/taxonomy/edit/vocabulary/(vid)' is a good start. It defines which content types are disallowed. But the 'required' checkbox is too simple. Perhaps it could be replaced with something like the following multi-select list:

Required:
-forum topic
-story
-page
(Every selected node type must have at least one term in this vocabulary.)

Comments

naught101’s picture

Version: x.y.z » 5.x-dev

I agree, this is something that makes HEAPS of sense. but a better way of doing it would be to have a "required" tick-box next to each type:
Types: *
o Event            o required
o Forum topic  o required
o Image          o required
o Page            o required
o Story            o required
--A list of node types you want to associate with this vocabulary.

I would be willing to take this on, with some help. ie. where do I start?

charly’s picture

bump

xjm’s picture

I'd also find this feature useful.

ekrispin’s picture

I'm also in need for such a flexibility. I have general instruction nodes that shouldn't have tags while I want to force users to tag their blog entries for example.

ekrispin’s picture

I meanwhile added the following tweak to taxonomy module that allows whomever has taxonomy administeration permission (me) to post nodes with no tags regardless of the value of the generic 'required' field in admin/taxonomy.

if (user_access('administer taxonomy')) $form['taxonomy']['tags'][$vocabulary->vid]['#required'] = FALSE;

Added it after line 711, right after:

$form['taxonomy']['tags'][$vocabulary->vid] = array('#type' => 'textfield',
          '#title' => $vocabulary->name,
          '#description' => $help,
          '#required' => $vocabulary->required,
          '#default_value' => $typed_string,
          '#autocomplete_path' => 'taxonomy/autocomplete/'. $vocabulary->vid,
          '#weight' => $vocabulary->weight,
          '#maxlength' => 255,
        );
arlinsandbulte’s picture

Version: 5.x-dev » 7.x-dev

+1 for this feature... bumping to 7.x-dev... maybe it is too late for that, though (8.x-dev???).

This makes PERFECT sense to me... why was this not done before?
Is there a contrib module that accomplishes this?

Thanks.

catch’s picture

Status: Active » Closed (won't fix)

This is now obsolete due to field API conversion.

naught101’s picture

Catch, could you please explain that a bit more, or at least give us a link to more info?

blackstallion’s picture

I am having the similar problem http://drupal.org/node/632606

ge’s picture

Apparently this is not being fixed in 7 because the flexibility of CCK integrated into core will change our options for taxonomies. I just downloaded 7 alpha (http://drupal.org/drupal-7.0-alpha1) and we'll see if it really does make this problem obsolete.

I still think there is a need for this for 6.x though. It's not like everyone's going to be running 7.x, even a year or two from now.

web2’s picture

Version: 7.x-dev » 6.15

Need contrib. module for this functionality.