Drupal 6 :: Embed block anywhere


/ Published in: PHP
Save to your folder(s)

Embed Drupal 6 block anywhere with proper block HTML IDs and classes.


Copy this code and paste it in your HTML
  1. $module = 'anymodulename';
  2. $delta = 'blockdelta';
  3.  
  4. $block = (object) module_invoke($module, 'block', 'view', $delta);
  5. $block->module = $module;
  6. $block->delta = $delta;
  7.  
  8. print theme('block', $block);

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.