I have created a custom node with a field where you can select one tag from a list of a custom taxonomy term (location)

I was originally using this to print out the name of the selected tag for the node:

echo $field_location[0]['taxonomy_term']->name;

However it has since stopped working (it now outputs NULL). All I have done since is remove an unrelated field in the content type.

Now when i do a var dump of $field_location all I get is:

array(1) { ["und"]=> array(1) { [0]=> array(1) { ["tid"]=> string(1) "1" } } }

Wheras before I had a load of extra stuff like the name of the tag etc...

Anyone have any ideas what's happened?

1 Answer 1


Go to Structure > Content types > Article > Manage display, for Article for example. If your field is in Hidden section (bottom of the page) then change Format of this field to other than Hidden.

  • Nope, its not that, checked all that and everything's fine. Nothing hidden.
    – Joe Taylor
    Commented Nov 17, 2013 at 17:18
  • do dpm($content['field_location']); for debug or print render($content['field_location']); to print in node, and question -where you do this - on node template or in preprocess func?
    – svetlio
    Commented Nov 18, 2013 at 8:05

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.