views:

1806

answers:

2

Hi,

In a module of mine, I'd like to output the node teaser. The node has CCK fields, and I'd like them to be displayed accordingly to the visibility settings you can choose in the content types / field settings administration area.

But when I do:

$html = theme('node', $n);

the resulting teaser won't contain the CCK fields, only title and body.

What other theming function do I need to call?

The node contains fields such as an image and a node reference. I suppose I could write the HTML manually, but it seems to me better to use the provided theming functions...

+5  A: 

http://api.drupal.org/api/function/node_view/6

$node = node_load($n);
$html = node_view($node,TRUE);

Then you can select the fields to display on Content Type>Display Fields after that, you can edit the theme of that teaser via contemplate module or node-content_type.tpl.php on the theme folder.

hecatomber
A: 

http://drupal.org/node/362068#comment-1216250 you can achieve it using views 2