Location -> samples, fixed cs display, fixed empty field
This commit is contained in:
@@ -63,7 +63,7 @@ function materio_showroom_field_info() {
|
||||
function materio_showroom_field_is_empty($item, $field) {
|
||||
// dsm($item,'item');
|
||||
// dsm($field,'field');
|
||||
return empty($item['location']) && empty($item['showroom_tid']);
|
||||
return empty($item['location']); // && empty($item['showroom_tid'])
|
||||
}
|
||||
|
||||
// ______ __
|
||||
@@ -115,12 +115,14 @@ function materio_showroom_field_formatter_view($entity_type, $entity, $field, $i
|
||||
// This formatter simply outputs the field as text.
|
||||
case 'materio_showroom_location_simple_text':
|
||||
foreach ($items as $delta => $item) {
|
||||
$term = taxonomy_term_load($item['showroom_tid']);
|
||||
$element[$delta] = array(
|
||||
'#type' => 'html_tag',
|
||||
'#tag' => 'p',
|
||||
'#value' => t('%showroom : @loc', array('%showroom' => $term->name, '@loc' => $item['location'])),
|
||||
);
|
||||
if(!empty($item['location'])){
|
||||
$term = taxonomy_term_load($item['showroom_tid']);
|
||||
$element[$delta] = array(
|
||||
'#type' => 'html_tag',
|
||||
'#tag' => 'p',
|
||||
'#value' => t('%showroom : @loc', array('%showroom' => $term->name, '@loc' => $item['location'])),
|
||||
);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user