I would like to access the title of the node a field belongs to in a field.tpl.php file. My goal is to transform the field into a mailto link that would use the node title as the subject field.
Is it possible to access that information at this point?

1 Answer 1


You could get the node values from: $element['#object']: The entity to which the field is attached.

So in this case if the field is a node field the $element['#object'] is the node object.

print $element['#object']->title;

Documentation: https://api.drupal.org/api/drupal/modules!field!theme!field.tpl.php/7

  • 1
    Thanks! I just found it meandring around the aptana debugger and the docs. That's just what I was looking for!
    – Dalmaz
    Commented Dec 28, 2014 at 19:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.