php - Accessing field value in Drupal 7 on load_node in template -
in template content type loading node node reference.
it loads , if print_r this:
stdclass object ( [vid] => 40 [uid] => 14 [title] => cover [log] => [status] => 1 [comment] => 0 [promote] => 1 [sticky] => 0 [nid] => 40 [type] => portfolio_image_main [language] => en [created] => 1309382711 [changed] => 1309382711 [tnid] => 0 [translate] => 0 [revision_timestamp] => 1309382711 [revision_uid] => 14 [field_portolio_image] => array ( [en] => array ( [0] => array ( [fid] => 5626 [alt] => [title] => [uid] => 14 [filename] => cover.jpg [uri] => public://cover.jpg [filemime] => image/jpeg [filesize] => 147898 [status] => 1 [timestamp] => 1309382711 ) ) ) [name] => jojo [picture] => 0 [data] => a:1:{s:7:"contact";i:1;} ) and im trying access single variable here:
$newimagepath1 = $newimage1->field_portfolio_image['en '][0]['filename'];
but far nothing. thoughts?
please try use below code
$keys = array_keys($arr[field_portolio_image][en]); $arr[field_portolio_image][en][$keys][filename];
Comments
Post a Comment