I need to embed each node I have in a different block. How can I achieve it?

If it makes any difference, I am using Drupal 7.

  • Do you want to have every block in blocks page of admin area?
    – Codium
    Feb 23, 2012 at 13:27

3 Answers 3


create a block and use the below code to get the node body field content.

$node = node_load(YOUR_NODE_ID);
$body_content = $node->body[$node->language][0]['value'];
print $body_content;

If you are using a field other than body field, then you should print_r that $node variable and you will get all content type field relate with particular node.From this array you can get the all values created by content types.


Sounds like Nodes In Block is exactly what you're after. Node Blocks might also help is the first one doesn't.

  • A vote for Node Block in particular. Using it for the original poster's use case and it does it perfectly. Can override the title from the node, contextual edit links work, choose the view mode overall or per node, all great.
    – mlncn
    Jun 23, 2014 at 12:15

In Drupal 9, a node can be embedded programmatically like this:

  public function build(): array {
    /** @var \Drupal\node\NodeInterface $node */
    $node = $this->nodeStorage->load(self::NID);
    $build['content'][] = [
      '#markup' => Markup::create($node->body->value),

Search for nodeStorage in core to see how to set that property in your block class.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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