Bulk assign nodes terms from one vocabulary based on terms already assigned from another vocabulary

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by neilt17 on October 13, 2012 at 7:11am

We have several hundred nodes categorised with terms from vocabulary A. We now want to categorise all these nodes with terms from a new vocabulary, vocabulary B. Terms in vocabulary B are roughly related to those in vocabulary A - so the idea would be to programmatically do a one time assignment of terms in vocabulary B based on terms already assigned to nodes from vocabulary A. After this, users of the site would need to do some further manual tweaking as there is only a rough (not exact) correspondence of terms between the two vocabularies.

You can see an example of where we want to do this here. The list in the right hand box is a list of terms in a vocabulary - and is based on a statutory framework issued by the UK department of education. This framework has recently been changed - hence the need to create a new vocabulary and assign new terms to nodes.

As the need to do this is likely to happen from time to time (in our case every time there is a change of government (!), and so we can use educational frameworks from different countries), I am planning to create a module which would allow an administrator to assign these new terms in bulk. The module would have something like this:

  • Page to set up the mapping between vocabulary A and B;
  • Possibly storage of these mappings;
  • Backup of term_node table when administrator executes the assignment operation - to facilitate a restore of data from this table if the admin makes a mistake.

Before I go ahead and do this, I was wondering whether something like this might already have been written - I have had a good look at existing Drupal modules - but haven't found any that have this functionality.

Categories:

Taxonomy

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /