function theme_contemplate_field in Content Templates (Contemplate) 7
Same name and namespace in other branches
- 5 contemplate.module \theme_contemplate_field()
- 6 contemplate.module \theme_contemplate_field()
Rewrite of theme_field to output default CCK output into the template.
Return value
unknown
1 theme call to theme_contemplate_field()
- contemplate_get_fields in ./
contemplate.module - get fields for the template edit form
File
- ./
contemplate.module, line 937 - Create templates to customize teaser and body content.
Code
function theme_contemplate_field($field) {
$output = '<div class="field field-type-' . strtr($field['widget']['type'], '_', '-') . ' field-' . strtr($field['field_name'], '_', '-') . '">' . "\n";
$output .= ' <h3 class="field-label">' . $field['label'] . '</h3>' . "\n";
$output .= ' <div class="field-items">' . "\n";
// Drupal Fields should come as an array and be treated as such
if (preg_match('/^field_/', $field['field_name'])) {
// @todo: still cant get fine grain build out of complex fields, render() renders all the field values
/* $output .= ' <?php foreach ( $fields as $field_name => $field ) { ?>' . "\n"; */
$output .= ' <div class="field-item"><?php print render( $fields[\'' . $field['field_name'] . '\'] ); ?></div>' . "\n";
/* $output .= ' <?php } ?>' . "\n"; */
}
else {
$output .= ' <div class="field-item"><?php print $node->' . $field['field_name'] . '[$node->language][0][\'safe_value\']; ?></div>' . "\n";
}
$output .= ' </div>' . "\n";
$output .= '</div>' . "\n";
return $output;
}