I am writing a module, in which I am required to display contents from multiple nodes. Using the configs I save, I will get the node id's in hook_block_view. Using that is there a way to get the contents of the particular node, so that I can manipulate on that?


Assuming by 'contents' you mean the HTML for the node in a particular view mode, you're looking for node_view():

Generates an array for rendering the given node.


$node = node_load(1);
$view = node_view($node, 'full');
$rendered = drupal_render($view);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.