I'm trying to find a way to let users select nodes from views results, and then get information from the selected nodes (such as node ID) for use in my module. This would probably be done in a form.
More broadly, what I'm trying to accomplish is to present users with a list of nodes tagged with a certain term x, have them to select any number of nodes from that list, and then have my module apply another term y to the selected nodes. I can handle that last part, but I'm struggling with creating a list of nodes that users can select from, and then somehow getting the information about the nodes selected that way.
I assumed views are the way to go but after a lot of searching I haven't found a way to achieve this functionality. Can anyone can show me a solution or point me in the right direction?
Thanks!
I'm using Drupal 7, and Views 7.x-3.7
EDIT: If I had the ability to select nodes with checkboxes via a module like VBO, I would like to do something like the following (terrible) pseudo-code:
foreach (vbo_selected_node) {
$node = vbo_selected_node -> node;
$nid = $node -> nid;
$node = node_load($nid);
$node->field_vocabulary_field['und'][0]['tid'] = $termID;
}
I hope that makes sense. Basically I want to take each selected node and apply another term to it.