(Tips) Drupal - how to display block in node?
Tips : Drupal - how to display block in node?
There used to be a module that did this, but I forget what it's called, and am unsure as to its compatibility with various versions of Drupal. The easiest and most direct way to place the contents of a block in a page are using the following PHP snippet:
<?php
$block = module_invoke('menu', 'block', 'view', 26);
print $block['content'];
?>Placing any Drupal block within a node
In this particular example, we're displaying a menu block with ID 26 inside a page. Here's how you use this code snippet to insert any block (this example uses Drupal 5.x; for other Drupal versions, the process should be similar):
- Browse to Site Building -> Blocks -> List
- Browse over the "configure" link next to your block
Courtesy : Community.contractwebdevelopment.com
- guru's blog
- Login to post comments
![Drupal-6-Book-[Building Powerful and Robust Websites with Drupal 6].jpg](http://www.drupalranch.com/images/Drupal-6-Book-[Building%20Powerful%20and%20Robust%20Websites%20with%20Drupal%206].jpg)