render block in d7

Events happening in the community are now at Drupal community events on www.drupal.org.
arne.olafson's picture

I'm trying to place the contents of a block in a custom jQuery list. To start out I'd like to just try rendering the contents of a block into a page or block, but am having difficulties. Any help would be appreciated. Here's the php code I'm using:

<?php
          $block
= module_invoke('webform', 'block_view', 'client-block-103');
          print
render($block);
?>

From instructions here:
http://drupal.org/node/1034524#comment-4100718

Update: This does not work for regular blocks either:

<?php
          $block
= module_invoke('block', 'block_view', '16');
          print
render($block);
?>

Comments

Fixed

arne.olafson's picture

I embedded the block in a View, and had better success, thanks to
http://api.drupal.org/api/drupal/includes%21module.inc/function/module_i...

Vancouver

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: