$table_data) { // Add the relationship only on the fid field. $data[$table_name][$field['field_name'] . '_fid']['relationship'] = array( 'handler' => 'views_handler_relationship', 'base' => 'file_managed', 'entity type' => 'file', 'base field' => 'fid', 'label' => t('file from !field_name', array('!field_name' => $field['field_name'])), ); } return $data; }