I have an Ajax handler script where I load a $nodeId
and output the result in default (full) view:
$node = node_load($input);
$prerendered_node = node_view( $node, 'default' );
...
Now I need to display the teaser (summary or trimmed) as well.
I tried this so far, without success (summary is filled in content):
1.
$item = $node->body['en'][0];
$output = field_view_value('node', $node, 'body', $item, 'Teaser');
echo $output; (blank)
2. echo $node->body['eng']['0']['summary']; (blank)
A solution from this question but not working:
3. $output = truncate_utf8(strip_tags($node->body['eng']['0']['summary']),200,true,true);
echo $output; (blank)
Curious is that var_dump($node->body['eng']['0'])
displays and array containing value
(of body), summary
, clean_summary
and other elements and the summary
has the necessary value filled. But as in example 2 I can't directly access it, it's coming up blank on display.
Tips, please?
Thank you.