Wednesday, July 18, 2018

Drupal 7: how to print node variable values from a content type template


//render/print contents
if($content['field_directory_in_state_intro']){print render($content['field_directory_in_state_intro']);}

//render/print image url from image field
if (isset($node->field_image[LANGUAGE_NONE][0]['uri'])) { print file_create_url($node->field_image[LANGUAGE_NONE][0]['uri']); }

*Please double check code first
Source: https://drupal.stackexchange.com/questions/42061/render-or-print-image-in-a-drupal-7-node-tpl

No comments:

Post a Comment