Search code examples
drupaldrupal-themingdrupal-7

Drupal 7: Access custom node field in page.tpl.php


I added a new field "mood" (image) to the page content type. Is there any way to access the image stored in this field in the page.tpl.php?


Solution

  • Should be

    $node = node_load($nid);
    $node->field_mood[$node->language][0]['value'];