Node reference field display I have a content type with several fields, some of them are node reference fields displaying multiple values. I've configured the display of one node reference field like teaser showing two fields "code, description".
The problem is when the node reference has more than one value, keeps adding lines to the bottom. I want to display this node reference field like "code1/code2 description1/description2" in one line.

How can I achieve this? What template should I override, field.tpl.php or node.tpl.php?
After a lot of research i finally solved my problem. I don't know if this is the best way of doing it but it works for me.

I added a THEME_field() function to my template.php of the desired field.

Inside my template function i removed the even/odd css classes because i want all in a single line.
Probably exists a better way to access field values, this was the solution i found. Digging the $item array i was able to get my code and color description values.

If someone knows a better way of doing this please help me improve it.
There goes the code i hope it helps someone else.
Don't forget to replace THEME by your theme name and the FIELDNAME.

function THEME_field__FIELDNAME($variables) {
$output = '';

// Render the label, if it's not hidden.
if (!$variables['label_hidden']) {
  $output .= '&lt;div class="field-label"' . $variables['title_attributes'] . '&gt;' . $variables['label'] . ':&amp;nbsp;&lt;/div&gt;';
}

// Render the items.
$output .= '&lt;div class="field-items"' . $variables['content_attributes'] . '&gt;';
$codes = "";
$colors ="";
foreach ($variables['items'] as $delta =&gt; $item) {

    $code = $item['field_color_description']['#object']-&gt;title_field['und'][0]['value'];
    $color = $item['field_color_description']['#object']-&gt;field_color_description['und'][0]['node']-&gt;title;

    $codes .= $code."/";
        //avoid repeated color descriptions
        if (strpos($colors,$color) === false)
        {
        $colors .= $color."/";
        } 
     }
     $classes = 'field-item even';

     $codeAndColors = rtrim($codes,"/") . " ". rtrim($colors,"/");
     $output .= '&lt;div class="' . $classes . '"' . ' title="'. $codeAndColors.'" '. $variables['item_attributes'][$delta] . '&gt;' . $codeAndColors . '&lt;/div&gt;';
     $output .= '&lt;/div&gt;';

     // Render the top-level DIV.
     $output = '&lt;div class="' . $variables['classes'] . '"' . $variables['attributes'] . '&gt;' . $output . '&lt;/div&gt;';

     return $output;


}