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!
Comment | File | Size | Author |
---|---|---|---|
#26 | 424070-multiple-vocabs-autocomplete.patch | 11.3 KB | xtfer |
#25 | content_taxonomy_autocomplete_vids_3.patch | 1.42 KB | tpfeiffer |
#23 | content_taxonomy_autocomplete_vids_2.patch | 5.76 KB | tpfeiffer |
#22 | content_taxonomy_autocomplete_vids.patch | 2.18 KB | tpfeiffer |
Comments
Comment #1
Flying Drupalist CreditAttribution: Flying Drupalist commentedSubscribe, definitely a wonderful request.
Comment #2
lor CreditAttribution: lor commentedI'm working on the subject. Maybe with hook_form_alter. Any ideas?
Comment #3
YK85 CreditAttribution: YK85 commented+1 subscribing
Comment #4
robby.smith CreditAttribution: robby.smith commentedHas anyone been able to come up with a solution? Thanks!
Comment #5
bunker CreditAttribution: bunker commentedI'd sure like to hear the solution
+1 subscribe
Comment #6
xjmBroadening 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.
Comment #7
xjmMarked #722088: multiple vocabularies exposed to autocomplete (freetagging) field as duplicate of this issue.
Comment #8
ChaosD CreditAttribution: ChaosD commentedsubscribed
Comment #9
rburgundy CreditAttribution: rburgundy commented+1 subscribing
Comment #10
ChaosD CreditAttribution: ChaosD commentedofc 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.
Comment #11
deltab CreditAttribution: deltab commented+1 Subscribing
Comment #12
kenorb CreditAttribution: kenorb commentedAny solutions?
Comment #13
blisteringherb CreditAttribution: blisteringherb commented+1 Subscribing
Comment #14
theshanergy CreditAttribution: theshanergy commentedsubscribe
Comment #15
clashar CreditAttribution: clashar commentedsubscribe
Comment #16
zazinteractive CreditAttribution: zazinteractive commentedI would like this as well. I don't think it's a rare usage
Comment #17
viren.ratan CreditAttribution: viren.ratan commentedsubscribing
Comment #18
phayes CreditAttribution: phayes commentedsubscribing
Comment #19
phayes CreditAttribution: phayes commentedI would add to this request the ability to disable lockdown to vocabulary at all, allowing for selection of *any* term across all your vocabularies.
Comment #20
fourmi4x CreditAttribution: fourmi4x commentedsuscribing
Comment #21
tpfeiffer CreditAttribution: tpfeiffer commentedI would like to have this as well. Anyone has an idea what exactly needs to be changed in order to get this feature?
Comment #22
tpfeiffer CreditAttribution: tpfeiffer commentedThe 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.
Comment #23
tpfeiffer CreditAttribution: tpfeiffer commentedThe 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?
Comment #24
kgeographer CreditAttribution: kgeographer commentedsubscribing
Comment #25
tpfeiffer CreditAttribution: tpfeiffer commentedOops, 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.
Comment #26
xtfer CreditAttribution: xtfer commentedTried 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.
Comment #27
rootwork#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.
Comment #28
rootworkUsing #23 and #25, I got the configuration checkboxes, but then got the error message:
The module might have just changed since these patches were originally written.
Comment #29
xtfer CreditAttribution: xtfer commented#23 and #25 don't really work properly. I can't repeat your issue at #27, do you have steps to repeat?
Comment #30
domdest CreditAttribution: domdest commented#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!
Comment #31
xtfer CreditAttribution: xtfer commentedPatch #26 breaks Features exports, FYI.
Comment #32
xaa CreditAttribution: xaa commentedsubscribe
Comment #33
NenadP CreditAttribution: NenadP commentedSubscribed 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.
Comment #34
chey CreditAttribution: chey commentedWhy 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.
Comment #35
xtfer CreditAttribution: xtfer commentedRe: #34, its a nice idea, but its probably a different feature request.
Comment #36
xtfer CreditAttribution: xtfer commentedComment #37
kenorb CreditAttribution: kenorb commented