Vocabularies required per content type
| Project: | Drupal |
| Version: | 5.x-dev |
| Component: | taxonomy.module |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
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.)

#1
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?
#2
bump
#3
I'd also find this feature useful.
#4
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.
#5
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.
<?phpif (user_access('administer taxonomy')) $form['taxonomy']['tags'][$vocabulary->vid]['#required'] = FALSE;
?>
Added it after line 711, right after:
<?php$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,
);
?>