Posted By

ihadgraft on 12/13/12


Tagged

drupal6


Versions (?)

Render a CCK field


 / Published in: PHP
 

The correct and reliable way to render a CCK field.

Variables used:

  • $field_name: the name of the field to render
  • $node: a node object
  • $teaser: TRUE if being rendered for a teaser
  • $page: TRUE if being rendered for a page
  1. // get the field
  2. $field = content_fields($field_name);
  3.  
  4. // render the field
  5. content_view_field($field, $node, $teaser, $page);

Report this snippet  

You need to login to post a comment.