0

Is there a way to transform a taxonomy term field into a simple text field? I need to keep all the terms present in the taxonomy field and have them separated by a comma.

1 Answer 1

0

Eventually, I simply used a PHP script I execute in mysite/devel/php to copy my taxonomy term field value to my new text field:

$nodes = node_load_multiple(array(), array('type' => 'contact'));
foreach($nodes as $node) {
  if ($node != NULL) {
    $tid = $node->field_title['und'][0]['tid'];
    $term = taxonomy_term_load($tid);
    $name = $term->name;
    $node->field_function_title['und'][0]['value'] = $name;
    $node = node_submit($node);
    node_save($node);
  }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.