-
-
Save dawehner/920260 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function asin_field_views_data($field) { | |
$data = field_views_field_default_views_data($field); | |
foreach ($data as $table_name => $table_data) { | |
foreach ($table_data as $field_name => $field_data) { | |
// Check for fieldapi value fields. | |
if (isset($field_data['filter']['field_name'])) { | |
$data[$table_name][$field_name]['relationship'] = array( | |
'handler' => 'views_handler_relationship', | |
'base' => 'amazon_item', | |
'base_field' => 'asin', | |
'label' => t('ASIN from !field_name', array('!field_name' => $field['field_name'])), | |
); | |
debug($data[$table_name][$field_name]['relationship'], "\$data[$table_name][$field_name]['relationship']"); | |
} | |
} | |
} | |
return $data; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks so much for your help.