The situation should be common: I have a content class with one location field; in the page view of the class I show the location on map. But, at the top of the page, I want to print the address too.

In the 'manage display' of my content type, I can choose for 'map only' (formatter location_map); which is perfect for the map, or for 'default (address only)' (formatter location_default), which is perfect for the top of the page.

It is probably as easy as, something like, in the node.tpl.php, saying

// address here

// google map here

but that doesnt work. I also notice Location has a theming hook, described here


unfortunately they forget to mention what goes in there. whatever i put in there, it doesnt pass to location.tpl.php (allthough it does pass that template in vain).

I have a workaround thats so ugly I'm not even going to post it here :-) Does anyone know how to do this properly ?


1 Answer 1


Ah, ..in my node.tpl.php

// address here
$fvf = field_view_field('node', $node, 'field_location', array(
print render($fvf);

// google map here
print render($content['field_location']);

Great article: http://www.computerminds.co.uk/articles/rendering-drupal-7-fields-right-way

pfew, *-pike

  • You should mark this post as answer even it is your own. Nov 30, 2013 at 13:36

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.