Within the node template, the $node object has the entity next to each 'target_id' value, making things nice and easy.
However if I load a node programatically (via node_load) it only has the target_id value, no entity is attached. So I'm having to do a lot of manual load_taxonomy(target_id) to get this.
So clearly Drupal at somepoint in the render pipe-line is doing this automatically, but Is there a function I could be calling to do it?
Thanks!
Try this:
if ($node = node_load($node_id))
{
$view = node_view($node);
}
http://api.drupal.org/api/drupal/modules!node!node.module/function/node_view/7
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With