how to insert page view of a node in another page in drupal

Posted by sprugman on Stack Overflow See other posts from Stack Overflow or by sprugman
Published on 2010-05-18T20:30:30Z Indexed on 2010/05/18 20:50 UTC
Read the original article Hit count: 225

Filed under:
|
|

I have a list of node ids and I want to display the 'page' view of each one. For various reasons, I don't want to do this with views, and don't think I should need a module. Just an API call to theme('node'). Something like:

$nids = array(3,4,5);
foreach ($nids as $nid) {
    $node = node_load($nid);
    $result .= theme('node', $node);
}

but I'm not getting back the full page view of the node. I added this to my node-[type].tpl.php file:

if ($page) print "PAGE MODE ";
else print "NOT PAGE ";
if ($teaser) print "TEASER MODE ";
else print "NOT TEASER ";

and got:

NOT PAGE NOT TEASER

I seem to be in some kind of limbo. I suspect there's an argument that I add to the theme function, but the terms are all so general (theme, teaser, page, node), I'm having trouble with my google-fu.

© Stack Overflow or respective owner

Related posts about drupal

Related posts about theme