Hello,

I was wondering if anyone can help to get the "send this item" as a field in Views?
I would really appreciate your help!

Thank you

Comments

charlie-s’s picture

Also looking for this. Subscribing.

Allie Micka’s picture

Title: Views integration » Add "send this item" field for Views

Good idea! I'm updating this issue's title to reflect the request

Rene Hostettler’s picture

Hi there

I achieved this functionality recently on a site using the views bulk operation module with a custom action for vbo.

Here is the code. You place it in an .inc file inside the vbo module directory and it should make it available as a custom action when you select vbo as the style for your view

// $Id: Send selected views nodes with send to friend module
  
/* function send_profile_info() {
  return array(
		'send_profile_action' => array(
      'description' => t('Send Selected Profiles to casting agent by email'),
      'type' => 'node',
      'configurable' => FALSE,
      'hooks'            => array('any' =>  true),
      ),
    
  );
} */

function views_bulk_operations_send_profile_action_info() {
  return array(
    'views_bulk_operations_send_profile_action' => array(
      'type' => 'node',
      'description' => t('Send Selected Profiles to casting agent by email'),
      'type' => 'system',
      'aggregate' => TRUE,
      'configurable' => FALSE,
      'hooks' => array('any' => TRUE),
    ),
  );
}

function views_bulk_operations_send_profile_action ($objects, $context = array()) {
	$base_url = $context['url'];
  // $objects is an array of object IDs, since the action includes aggregate.
  $sendnid = implode('+', $objects);
  drupal_goto($base_url . "send/send_node/" . $sendnid);
} 

it passes the selected node id's to the send to a friend page.