1
votes

n my module I use the hook_node_view to make alterations to the content when it is viewed. To do this I fetch and set $node->content['body'][0]['#markup']. It works fine, but I've lately had some trouble with my teaser views which made me track the problem to the data fetched from $node->content['body'][0]['#markup'].

It seem like what is in it depends at least on the view mode because if I do write

print $node->content['body'][0]['#markup'];

either when the mode is 'full' or when it's 'teaser' I get different results. For some reason the content of $node->content['body'][0]['#markup'] is very short when I view the content as a teaser. Shorter then the teaser length even.

This made me wonder more about what is in $node->content['body'][0]['#markup'], and when and where it is set?

1
It all starts with node_build_content()...you can use the links in the function code to dig further from there. Don't plan to do much else for the next few hours if you really want to understand how it works ;) - Clive

1 Answers

0
votes