hi guys,

why i cannot print node values with ['view'] if i use node_load, only ['value'] works?

for example

$node->field_lastname[0]['view']

not work with node_load

$node->field_lastname[0]['value']

only work

greets

Lausch

Comments

nevets’s picture

From your example the node is from a CCK content type. It would make sense that on node_load only the values are load (['value']) and the view version is only set on node_view.

Lausch’s picture

ah ok, thanks for the informations

cghobbs’s picture

I had the same issue. If you do something like this it works:

$node = node_load(array("nid" => $node->nid));
node_invoke_nodeapi($node, 'view');
webpoga’s picture

Brilliant! whew... tnx a lot!
btw you can also call it like this:

$node = node_load($nid); //or whatever the node id is...
yesct’s picture

I was having this same problem! Thanks!

Tom Ash’s picture

This doesn't work for me - and print_r($node) confirms that only [value] not [view] is created.

socialnicheguru’s picture

subscribing

http://SocialNicheGuru.com
Delivering inSITE(TM), we empower you to deliver the right product and the right message to the right NICHE at the right time across all product, marketing, and sales channels.