How to display a drupal block in a node

How to display drupal blocks inside a node (story)

I have been using Drupal for a long time now and havent really been able to achieve this. But it seems it is as simple as finding out the block number (here its 26) and then just insert the below code. Make sure input format is pho code, otherwise block wont work.

<?php
$block = module_invoke(‘menu’, ‘block’, ‘view’, 26);
print $block['content'];
?>

Note: If you make an error while inputting this php code your drupal install may break, so make sure you try it on a test install first. To recover, go to phpmyadmin and find this text and remove from the node. That should get you up and running again.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Google Bookmarks
  • IndianPad
  • MisterWong
  • Simpy
  • Technorati
  • Wikio

One Response to “How to display a drupal block in a node”

  1. Thanks. that helps
    :)

Leave a Reply

RSS for Posts RSS for Comments