The policy from the CCK teams seems to be to advice all themers to use the content_format() function instead of using directly the view-property in the data array.
Unfortunately we don't have enough data to do so in a contemplate, or where do I get $item from?
Once we have that, filling in the right values for content_format($field, $item, $formatter = 'default', $node = NULL) shouldn't be that hard ...

Comments

ray007’s picture

Category: support » feature
Priority: Normal » Minor

Not for the first time I found the error not long after posting the issue.
After supplying all the arguments required by the view to the viewfield, the item also got the missing properties.

So I'd like to modify this issue to a feature request: modify the predefined output for the templates to use content_format() instead of directly printing out the view-field of the item.

And sorry for the noise.

OpenChimp’s picture

I think this is a great idea. I've been learning to theme drupal for a long time. I always wanted to be able to format the output of fields using the settings as configured in the cck administration. Apparently content_format() is the way to do this, but I only recently discovered it because of a helpful response to a related issue with formatting the output from a date field.

If the theme wizard had used

print content_format('field_xxxxx_xxx', $node->field_xxxxx_xxx[0], 'default');

instead of

print $node->field_xxxxx_xxx[0]['value'];

then I could have learned about the use of this function long ago.