Just a quick question about how I determine the name of a CCK field in the PHP custom field.
I'm aware there are plenty of threads with examples, but none of these give me a clear indication of how to determine what name I should use for my field.

I usually use $node = node_load($data->nid); to access my field values, and then for images, construct the theme output using imagecache and the filepath - that said , there's an inherent issue with this technique as when themeing imagecache images from Views Custom Field, the default image on the field is not respected.

Anyhow, back to original point.

If i have a field called.

field_myimage

How do i determine it's name from the $data variable?

I've seen examples such as

$data->node_field_my_image;
$data->node_field_my_image_fid;

etc.. etc.. What's the rule for working this out?

Comments

giorgio79’s picture

Install the http://drupal.org/project/devel

and then you can output $data like dpm($data); in your php code. From there you can work it.

hixster’s picture

Thanks Georgio, cool i see how it works.