1

I have several vocabularies some of which are related to the same concept. Ex:
- Car
- Bicycle
- Boat
- Tags
- Countries

In the above example, Car, Bicycle & Wheel could all relate to "Vehicles". I would like to group these vocabularies in order to pull out all vocabularies related to Vehicles...

Is there any way I can add this relation ?

  • 2
    are you using D6 or D7 ? – Bala Jun 28 '13 at 8:55
6

Assuming D7, you can add a field to the vocabulary entity to group the vocabularies together.

For example, you could add another vocabulary "Group" that contains your vocabulary group terms. You could then add it either as a select or free-tagging style term reference field on your other vocabularies and link them that way.

Admin > Structure > Taxonomy > Edit Vocabulary > Manage Fields

You may also want to consider using a single hierarchical vocabulary where the terms are nested under a parent term, e.g 'Vehicle' (recommended)

  • Thanks David. Drupal 7 indeed. Adding a group field to the vocabulary seemed the easy way but this adds a field to the taxonomy terms, not the vocabulary. Still feaseable but not ideal and will require to edit all existing terms. Hierarchical terms with group parent seems more logical to me but I am doing some work on an existing site and I'm worried of the implications of changing the terms structure. I see there is a "hierarchy" column in the taxonomy_vocabulary table. What is this column used for ? – benezech jerome Jun 28 '13 at 22:56
  • You may want to consider migrating all terms to a new hierarchical vocabulary. A module like term_merge could help. Regarding the hierarchy flag: " If no term has parent terms then the vocabulary will be given a hierarchy of 0. If any term has a single parent then the vocabulary will be given a hierarchy of 1. If any term has multiple parents then the vocabulary will be given a hierarchy of 2." see taxonomy_check_vocabulary_hierarchy for more info. – David Thomas Jun 29 '13 at 0:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.