Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
ray007 CreditAttribution: ray007 commentedNot 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.
Comment #2
OpenChimp CreditAttribution: OpenChimp commentedI 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
instead of
then I could have learned about the use of this function long ago.