Ability for user to flag or select multiple nodes from view listing I am creating a page where I have a view listing about 100 nodes of a specific content type and then underneath that I have a contact form. When visitors (logged out users) come to my site I would like them to be able to select some nodes from this view that they like. Either with a checkbox next to each one of them or by some other flagging system. When they then complete my form the specific nodes they have chosen will be sent with the form submission. 

Possible Solutions:


Create a template file for the view and add in a checkbox in front of each node.
Use the flags module and pass the selected nodes when submitting. 


I've never done something like this before so any help would be appreciated!
Here is a solution with webform and flags:

1. Create a small module.
You can create a very simple module for it - an info file and a module file with your functions. https://drupal.org/node/1074360

2. Implement hook_webform_submission_presave().
This will intercept the form data on the webform submission form submission form before it gets saved in the database.

3. Get the flags that the current user flagged with flag_get_user_flags().
You will receive an array of flags, that you can process as you like, add to form results array for later use, or, if you have a hidden text area called 'flags' in your form, insert that data there as a formatted text.

So, in totality, it will be something like this:

function leadflag_webform_submission_presave($node, &amp;$submission) {
  $nodes_list = '';
  $title = '';
  // Get the flags.
  $flags = flag_get_user_flags('node');
  // Get the nodes.
  if (!empty($flags)) {
    $flags = $flags['flag_name'];
    foreach ($flags as $flag) {
        $nid = $flag-&gt;entity_id;
      // Get node data. Delete to not get node titles.
      $node = node_load($nid);
      $title = $node-&gt;title;
      // Combine data.
      $nodes_list .= 'node/' . $nid . ' ' . $title . ",\n";
    }
  }

  // Update some component's value before it is saved.
  $component_id = 4;
  $submission-&gt;data[$component_id][0] = $nodes_list;
}


This function gets flagged nodes and populates the webform component 4 with node/nids and titles, like this:

node/10 Node Title of node 10,
node/21 Node Title of node 21, etc


The function gets the flags and puts them in form component 4. You need to hover your mouse over your textarea component edit link on the webform components edit page to see what component number it actually is, in the edit link url. Replace the component number in code with your actual component number.

There is a section (lines 13-15), that loads nodes to get their titles. Doing node loads is somewhat an expensive function. It's Ok unless you expect dozens of submissions per minute though. But to not have node_loads, and to only have a list like 'node/10, node/15' without titles, you can delete these lines.