Exclude a not-hidden field in the content In Drupal 7, I'm tying to show all the taxonomy terms from a specific vocabulary linked to the current node being viewed. I'm doing this with a new block defined in my module.

I added a field called tags in my contenttype and gave this field the whole taxanomy behavior. This made it possible to get the terms with:

$node = menu_get_object();
$node-&gt;field_tags &lt;- array of tags to use


But, here comes the problem, this field is only there when it's set to visible in admin/structure/types/manage/page/display . But when i do that it also becomes visible in the content. If i put it to hidden it does not only get removed in the content/node view, but it's also gone from the whole $node object.

It there a way of getting the fields from the current node that are set to hidden?

Thanks,
Jonathan
The field shouldn't be removed from the $node object...if it is then I'd check what custom/contrib modules you have installed that might be causing this to happen. It's not supposed to.

A sure-fire way to make sure all fields are attached to the object is to re-load it:

$node = node_load($node-&gt;nid, NULL, TRUE);


That will re-load the $node fresh from the database, with all fields attached. You do take a performance hit doing this. However, Drupal core will never have removed the field from the $node object in the first place, so if you've got some other theme/module that's doing this you'll either have to find/repair/remove it, or use a more a extreme method like the one above.