Drupal Questions & Answers

Ask and answer Drupal related questions! No question too simple or complex!
gallamine's picture
Asked by on Sun 15th Mar 2009
How do I display a Views 2 block inside of a node (or profile)?

I’m trying to display a Views 2 block inside of a node. Ordinarily I’d use this code:

$block = module_invoke('block_name', 'block', 'view', 0);
print $block['content'];

Where the ‘block_name’ and the number at the end can be found by looking at the link to the “Configure” page in the Admin -> Blocks area.

However, when you use Views to create a Block, there is no associated block number. I’ve tried various combinations of the above code, and nothing seems to work. Does anyone have any thoughts?

Commenting on this Drupal Question is closed.