function theme_contemplate_field in Content Templates (Contemplate) 5
Same name and namespace in other branches
- 6 contemplate.module \theme_contemplate_field()
- 7 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()
File
- ./
contemplate.module, line 814 - Create templates to customize teaser and body content.
Code
function theme_contemplate_field(&$field) {
$output = '';
$output .= '<div class="field field-type-' . strtr($field['type'], '_', '-') . ' field-' . strtr($field['field_name'], '_', '-') . '">' . "\n";
$output .= ' <h3 class="field-label">' . $field['widget']['label'] . '</h3>' . "\n";
$output .= ' <div class="field-items">' . "\n";
if ($field['multiple']) {
$output .= " <?php foreach ((array)\$node->" . $field['field_name'] . " as \$item) { ?>" . "\n";
$output .= ' <div class="field-item">' . "<?php print \$item['view'] ?>" . '</div>' . "\n";
$output .= " <?php } ?>" . "\n";
}
else {
$output .= ' <div class="field-item">' . "<?php print \$node->" . $field['field_name'] . "[0]['view'] ?>" . '</div>' . "\n";
}
$output .= ' </div>' . "\n";
$output .= '</div>' . "\n";
return $output;
}