You are here

function node_field_link_formatter in Node Field 7.2

Formatter for link field.

1 string reference to 'node_field_link_formatter'
node_field_types_info in includes/node_field.field.inc
Node field types info.

File

includes/node_field.field.inc, line 256
Field types, settings, widget and formatters.

Code

function node_field_link_formatter($node_field) {
  if (empty($node_field['settings']['url'])) {
    return;
  }
  if (!$node_field['value']) {
    $link = l($node_field['settings']['url'], $node_field['settings']['url']);
  }
  else {
    $link = l($node_field['value'], $node_field['settings']['url']);
  }
  return $link;
}