When using taxonomy to group nodes on your Drupal site, you find a need to apply another taxonomy term to all of those nodes (possibly from a different vocabulary) there is nothing that is going to be shorter and sweeter than some quick SQL-fu.
Here is a quick MySQL snippet to do just that:
create temporary table my_temp_table as
select * from term_node where tid = XXX;
insert into term_node (nid,tid) select nid, 'YYY' as tid from my_temp_table
Just replace XXX with the TID of the term that is already grouping your content, and replace YYY with the TID of the term you want to apply to all of them. You can comment out the first and last lines to use the select statement to check to make sure that these are the nodes you're after before committing all of the insert statements to the Database.
Enjoy!
Comments
Pingback
[...] Go to the author’s original blog: Relate all nodes from one taxonomy to another with MySQL [...]
Cant this be simplified
Cant this be simplified to...
INSERT INTO term_node (nid,tid) SELECT nid, Y FROM term_node WHERE tid = X;
does anyone know a way to
does anyone know a way to build a related nodes link block not based on taxonomy, but on similarity in the node title?