You are here

function theme_contemplate_field in Content Templates (Contemplate) 6

Same name and namespace in other branches
  1. 5 contemplate.module \theme_contemplate_field()
  2. 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()
contemplate_cck_get_fields in ./contemplate.module

File

./contemplate.module, line 907
Create templates to customize teaser and body content.

Code

function theme_contemplate_field($field) {
  $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;
}