I am using Drupal 7. I installed the computed field module and have a computed field in a content type. I need to be able to access the actual name of a node reference field that is in the same content type so i can then work with the data in the computed field. Currently I can only get the number of the node reference field using this in the computed code (php) field:
$entity_field[0]['value'] = array_pop(field_get_items($entity_type, $entity, 'field_charity_reference'));
I need to be able to access a 'drill' into the the node reference to get the rendered title, which is a human readable name.
When using views and custom php I can use dpm($data);
to explore the data and use this to work out I can access the rendered title by using:
$data->field_field_charity_reference[0]['rendered']['#title']
Since originally posting this question I have found i can use dpm(field_get_items($entity_type, $entity, 'field_charity_reference'));
in the 'Display Code (PHP)' input in the computed field to give a devel printout of the field I wish to access data from.
I would like to know how to drill into the results returned by field_get_items($entity_type, $entity, 'field_charity_reference')
in order to output the name of the node reference field. Thanks