更改imagefield的图片的alt和title值为terms和desrction

imagefield_formatter.inc

  // For all taxonmoy terms
    $node = $element['#node'];
  $my_value = array();
  foreach  ($node->taxonomy as $tid => $term) {
    $my_value[] = $term->name;
  }
  $imgterms = implode(' ', $my_value);
  $item['data']['alt'] = $imgterms.' aaa bbb ccc';
 

  $item['data']['title'] = isset($item['data']['description']) ? $item['data']['description'] : NULL;

你可能感兴趣的:(image)