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

OpenChimp’s picture

Would like to know this, too, thanks.

jimwebb-1’s picture

It 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.

rantebi’s picture

Even 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".

karens’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.