I'm using the Content Taxonomy fields, not to assign terms to nodes, but as a "Term Reference" field on a homepage. The term selected in the field will be sent to a View as an argument. The customer wants to be able to switch the term, but not be limited to one Vocabulary.

My current solution is to have a CT select widget for each and every vocabulary (there are 6), group them together, and display instructions to select a term from only one widget, so that the View doesn't returned mixed results. It does the job, but is fugly, to be kind.

What I'd rather have, is the ability to select multiple vocabularies for exposure in a single CT select widget. The vocabulary names would be visible in the widget, but not selectable, kind of like the 'parent term' filter in the CT field configuration that shows all the vocabs and terms for the entire site taxonomy, in one big pulldown.

Though it would see rare usage, it would be great to have this as an option.

Also, since I'd love to be able to provide this for my customer, any tips on how I'd do this would be greatly appreciated and would give me a headstart. I understand hooks, form_alter, etc so feel free to be technical. ;)

Anyway, great module. Love it!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Flying Drupalist’s picture

Subscribe, definitely a wonderful request.

lor’s picture

I'm working on the subject. Maybe with hook_form_alter. Any ideas?

YK85’s picture

+1 subscribing

robby.smith’s picture

Has anyone been able to come up with a solution? Thanks!

bunker’s picture

I'd sure like to hear the solution

+1 subscribe

xjm’s picture

Title: Is it possible to put ALL terms in one select widget? » Allow multiple vocabularies in one Content Taxonomy field

Broadening the scope a bit to include any widget. It seems to me that this should be possible to support in the base field, as it doesn't matter to the base module or core taxonomy what the vocabulary is when saving a node.

The only problem I could see would be in the case that users are allowed to add terms. In that situation, if the field included multiple vocabularies, it would be impossible to tell which vocabulary the term should be saved to, unless one vocab was considered the "main" vocab for the field.

xjm’s picture

ChaosD’s picture

subscribed

rburgundy’s picture

+1 subscribing

ChaosD’s picture

ofc in this case free tagging should not be allowed. i think the main concern here is to combine existing terms of different vocabularies in one field. iam also interested in this because iam using CT as exposed filter in views with autocomplete as a search function for my users.
extending the global settings of a CT field to accept more than one vofabulary selected would solve everything requested here.

deltab’s picture

+1 Subscribing

kenorb’s picture

Any solutions?

blisteringherb’s picture

+1 Subscribing

theshanergy’s picture

subscribe

clashar’s picture

subscribe

zazinteractive’s picture

I would like this as well. I don't think it's a rare usage

viren.ratan’s picture

subscribing

phayes’s picture

subscribing

phayes’s picture

I would add to this request the ability to disable lockdown to vocabulary at all, allowing for selection of *any* term across all your vocabularies.

fourmi4x’s picture

suscribing

tpfeiffer’s picture

I would like to have this as well. Anyone has an idea what exactly needs to be changed in order to get this feature?

tpfeiffer’s picture

The attached patch adds a list of all vocabularies with checkboxes to the CCK field configuration, such that you can choose multiple vocabularies (let's call them "secondary vocabularies") from which you want to select terms. The select box for the "primary vocabulary" is still present, though. The patch also modifies the autocomplete widget in such a way that terms from all those chosen vocabularies are displayed.

However, the selected terms are not yet written to the database, i.e. the patch is of not much use yet; I'm working on that.

tpfeiffer’s picture

Status: Active » Needs review
FileSize
5.76 KB

The attached patch is a superset of the previous one. It allows to also store the terms selected using the autocomplete widget in the CCK table. I have not checked whether it also stores to the taxonomy tables as well, as this is not needed at my place. If the term does not exist, it is created in the primary vocabulary (which should always also be selected as a secondary vocabulary).

For me, this is all I needed so far. Maybe someone else can add the missing functionality?

kgeographer’s picture

subscribing

tpfeiffer’s picture

Oops, the above patch (from #23) actually removes values from the CCK field, if the primary vocabulary is not contained within the secondary vocabularies. The attached patch (applied after #23) fixes this.

xtfer’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev
Component: Option Widgets » Autocomplete - Freetagging
FileSize
11.3 KB

Tried the patches above, but they didnt quite do the job - the same term name in multiple vocabularies caused duplicates, for example. The following patch takes the changes from tpfeiffer and adds the following:

- Prefixed [tid:xxx] values in autocompletes to ensure the correct tags are saved.
- Prefixes loaded terms in autocomplete dropdown with Vocabulary names, so the user can pick from the correct vocabulary.

rootwork’s picture

#26 applied for me (though note 2.x branch) and gave me a nice configuration setup, but when I went to the node form, it still only displayed the values from the "primary" vocabulary, not all of the "secondary" ones I selected.

rootwork’s picture

Using #23 and #25, I got the configuration checkboxes, but then got the error message:

warning: Invalid argument supplied for foreach() in [webroot]/web/includes/form.inc on line 1212

The module might have just changed since these patches were originally written.

xtfer’s picture

#23 and #25 don't really work properly. I can't repeat your issue at #27, do you have steps to repeat?

domdest’s picture

#26 worked pretty well for me, after a tweak to one part of the patch to accommodate some peculiarities with my particular site's CMS. Thanks!

xtfer’s picture

Patch #26 breaks Features exports, FYI.

xaa’s picture

subscribe

NenadP’s picture

Subscribed to this. In meantime, i will use multiple Vocabulary fields with Conditional Fields module to make easier for the user. With creation of drop down list field containing all my Vocabulary names, I can hide/unhide Vocabulary fields, and so user is able to select in which Vocabulary he want to select term, and then see only that Vocabulary field.

chey’s picture

Why not on the field editing page (i.e. admin/content/node-type/page/fields/field_my_ct_field) allow users the ability to select a term View (requires Views)? And the user would of course have configured a term View that displays the terms that they want to show up in the field. Works sort of like the User Reference and Node Reference field types and their advanced options.

xtfer’s picture

Re: #34, its a nice idea, but its probably a different feature request.

xtfer’s picture

Status: Needs review » Needs work
kenorb’s picture

Priority: Normal » Minor
Issue summary: View changes