function theme_ds_field in Display Suite 6
Same name and namespace in other branches
- 6.3 theme/theme.inc \theme_ds_field()
- 6.2 theme/theme.inc \theme_ds_field()
Theme function to render the field content.
Parameters
string $content The content to render.:
array $field Collection of field properties.:
1 theme call to theme_ds_field()
- views_plugin_ds_fields_view::ds_views_fields_render in views/
views_plugin_ds_fields_view.inc - Render the content for modules not implementing the ds api.
File
- theme/
theme.inc, line 14 - Theming functions for ds.
Code
function theme_ds_field($content, $field) {
$output = '';
if (!empty($content)) {
if ($field['type'] == 'ds') {
$output .= '<div class="field ' . $field['class'] . '">';
// Above label.
if ($field['labelformat'] == 'above') {
$output .= '<div class="field-label">' . $field['title'] . ': </div>';
}
// Inline label
if ($field['labelformat'] == 'inline') {
$output .= '<div class="field-label-inline-first">' . $field['title'] . ': </div>';
}
$output .= $content;
$output .= '</div>';
}
else {
$output = $content;
}
}
return $output;
}