bratsun
1/22/2014 - 2:46 PM

Formatter: H2 from text or computed field (exported custom formatter)

Formatter: H2 from text or computed field (exported custom formatter)

$formatter = new stdClass();
$formatter->disabled = FALSE; /* Edit this to true to make a default formatter disabled initially */
$formatter->api_version = 2;
$formatter->name = 'h2_from_field';
$formatter->label = 'H2 from field';
$formatter->description = '';
$formatter->mode = 'php';
$formatter->field_types = 'text, computed';
$formatter->code = '$output = \'\';
foreach ($variables[\'#items\'] as $item) {
  $output .= \'<h2>\' . $item[\'value\'] . \'</h2>\';
}
return $output;';
$formatter->fapi = '';