function eieditions_preprocess_views_view_field(&$vars) {
$view = $vars['view'];
$field = $vars['field'];
$row = $vars['row'];
if ($view->name == 'homepage_features' && $view->current_display == 'node_content_4') {
// This is the only reliable way to find unique names for fields in rows
// containing custom fields.
$fields = array_keys($view->display_handler->get_handlers('field'));
switch ($fields[$field->position]) {
// 'nothing' is the figure field.
case 'nothing':
$node = node_load($row->node_node_data_field_banner_nid, $row->node_node_data_field_banner_vid);
if (count($node->field_illustration)) {
// The node has illustration node references.
$illustration_node = node_load($node->field_illustration[0]['nid']);
// TODO: make this work for embedded images
$image = content_format('field_image', $illustration_node->field_image[0], 'wide16gold_default', $illustration_node);
$creator = content_format('field_creator', $illustration_node->field_creator[0], 'default', $illustration_node);
$publisher = content_format('field_publisher', $illustration_node->field_publisher[0], 'default', $illustration_node);
}
else {
// TODO: support decoration reference fields.
}
$vars['output'] = theme('figure', $image, $creator, $publisher);
break;
// 'nothing_1' is the author/publisher credit for the featured item.
case 'nothing_1':
$field_creator_value = $view->display_handler->get_handler('field', 'field_creator_value');
$field_publisher_value = $view->display_handler->get_handler('field', 'field_publisher_value');
$vars['output'] = '<div class="credit vcard">';
$vars['output'] .= '<span class="fn">'. $field_creator_value->render($row) .'</span>';
if ($field_publisher_value->render($row)) {
$vars['output'] .= '<span class="o">'. $field_publisher_value->render($row) .'</span>';
}
$vars['output'] .= '</div>';
break;
}
}
}