I'm trying to change the default link generate by the email_field module so It shows an image instead of the text (Contact person by email).
I went into the module and foun the part I need to change, but because I'm new to drupal and php I have no clue how to change it...
The code I think I need to override:
function email_field_formatter_view($object_type, $object, $field, $instance, $langcode, $items, $display) {
$element = array();
switch ($display['type']) {
case 'email_contact':
$ids = entity_extract_ids($object_type, $object);
foreach ($items as $delta => $item) {
$element[$delta] = array('#markup' => l(t('Contact person by email'), 'email/' . $object_type . '/' . $ids[0] . '/' . $instance['field_name']));
// Since email is always sent to first item's email, break after any email address found.
break;
}
break;
}
}
The contact person by email is the part I want to change to
'< div class="email_image">< /div>'
Anyone who can help with this? Or knows where I can find some help?
Thx up front.