Closed (fixed)
Project:
Content Construction Kit (CCK)
Version:
7.x-2.x-dev
Component:
CCK in core
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
8 Feb 2011 at 06:45 UTC
Updated:
1 Apr 2011 at 13:11 UTC
I've searched for a long time but cannot find a drupal 7 variant of content_format Does such a thing exist for Drupal 7?
Comments
Comment #1
OpenChimp commentedWould like to know this, too, thanks.
Comment #2
jimwebb-1 commentedIt appears to me that
render($content["your_field_name"][0])may do the equivalent.
Adding the zero index makes the render function return the formatted value of the field; if you leave off the zero index (e.g.,
render($content["your_field_name"])) you'll get the field title along with the value.Comment #3
rantebi commentedEven better than content_format, this function returns the field value in the standard way:
$attorneyImage = field_view_field('node', $node, 'field_attorney_image');Since drupal 7 is all about renderable arrays, the return value of this function is also a renderable array. So in my opinion this is even better than "content_format".
However, If you still need the markup of this then you should use "drupal_render".
Comment #4
karens commented