I use CiviCRM 4.6.14 with Drupal 7.43. I have defined a Drupal content type with a field that contains a CiviCRM contact using the civicrm_entity
module.
When I render this content type, I want to access a few fields from the contact - namely, its name, website, and a Google map link (derived from its address or geocode or whatever's best). In PHP, how can I access these fields from the $content
object? If I var_dump($content)
I can see the name & geocode, but not a full address (should I piece that together from component fields? seems error prone) and no website field at all.
If I do this by trial and error using var_dump
, I'm going to end up with code like
print($content['field_venue']['#items'][0]['entity']->display_name);
which doesn't seem healthy.