I'm trying to get my mind around how things are displayed to the user.

For example I am referencing fields in a content type 'district' called 'field_code' which has values like CCQ FFI EEJ AAS basically 3 letter codes

However in my list of values in field reference I don't see those codes anywhere! All I see is NODE TITLE : FIELD LABEL

What do I need to see the field label for? I know what the field label is. Show me the field VALUE!

Comments

danielb’s picture

OIC that wouldn't work for images or files or long text, or pretty much every other application apart from mine. I will hack together something for myself :D

danielb’s picture

Status: Active » Fixed

I just added this to template.php

function phptemplate_fieldreference_item_simple($item, $multiple = FALSE) {
  
  $fieldval = db_result(db_query("SELECT ". $item->name ."_value FROM {content_type_". $item->type ."} WHERE nid = %d", $item->nid));
  
  $output = $fieldval.' ('.$item->title.')';
  
  if ($multiple) {
   $output .= ':' . $item->delta;
  }

  return $output;
}

winner

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.