Is there some way to make a copy of a taxonomy term? Some way to automatically add a tag to all nodes already tagged with a certain term?

For example...

I have a taxonomy term "Example" tagged to a number of nodes and I want every node tagged with "Example" to also get tagged with "Ex".

I've tried "Taxonomy Manager" The "Merge" feature is pretty nice but it only will merge terms, it does not leave the existing term in tact.
I can convert "Example" to "Ex" or vice versa but there doesn't appear to be a way to convert "Example" to "Ex" and leave "Example" in place...

So is there some way to make a copy of a term? I'm not referring to making terms "related" or "synonyms" I want to have to post actually tagged with both terms.

Any suggestions appreciated

Thanks!

Comments

justageek’s picture

I think it would require some custom code to retrieve the nodes for a specific term and then add the second term to each node and then save.

cosmosian’s picture

Create a rule to look for the tag "Example" and "Ex" after saving the node, and if either is missing to add the other one.

chunty’s picture

Did you ever manage to make this work, I'm after the same thing.

Chris

wizonesolutions’s picture

I'm after the same thing as well.

Support my open-source work: Patreon | Ko-Fi | FillPDF Service

jason_purdy’s picture

So for D6, if you can manipulate the database, you can copy term assignments from node to node. It's all in one table (term_node) and what you want to do is start by knowing your term ID's. Look in your taxonomy list (/admin/content/taxonomy/list), click on the list terms link and then hover on the edit link to see the ID # (/admin/content/taxonomy/edit/term/600?...). Know the term ID's for the terms you want to get node associations for and then know the term ID you want to add to that node.

Then you would do a query like this:

select nid,vid from term_node where tid IN (600,4118) and vid NOT IN ( select vid from term_node WHERE tid = 522581 );

The 600 and 4118 numbers are taxonomy term IDs on my site called "Food Safety" and I have a similar "Food Safety" term (the ID # 522581) in another vocabulary that I want to make sure nodes are associated w/ that term, too. So that query gives me the nodes & revisions. You can review the list and when you're comfortable, then you can insert based on that query:

INSERT INTO term_node (nid,vid,tid) select nid,vid,522581 from term_node where tid IN (600,4118) and vid NOT IN ( select vid from term_node WHERE tid = 522581 );

If you run the first query again, you should now see 0 results and your destination term should now have nodes associated w/ the other terms associated with it.

Hope that helps!