Closed (fixed)
Project:
Dynamic display block
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
20 Feb 2011 at 20:06 UTC
Updated:
16 Apr 2011 at 11:10 UTC
Hi folks,
Love this module! But, having trouble embedding into a node. I set my input type to PHP and embeded this code:
$block = module_invoke('ddblock', 'block', 'view','1');
print $block['content'];
The "1" was the block number I got when hovering over the block link. Any idea what I'm doing wrong?
Here's a link to that test page if you want to see. Many thanks!!
http://www.burnardweb.com/take3/node/9#overlay-context=node/9
Comments
Comment #1
ppblaauw commentedThe block hooks in drupal core have changed. Instead of one hook_block with operants there are now 4 separate block hooks.
To embed a block in drupal 7 use:
Parameters in module invoke
first parameter - module to call: 'ddblock'
second parameter - hook to call: 'block_view'
third parameter - arguments: in this case the delta of the block
Hope this helps you further, please let me know.
Comment #2
jburnard commentedThat did it! Thanks so much for the quick reply!
Comment #3
ppblaauw commentedset status to fixed.
Comment #5
halohaloplace commentedThis works like magic. However, is there a way to embed a block that can be viewed by permission (e.g., by admin only)? I tried to set permission to view this block then followed the code above, but it still show to anonymous viewers. Any answer is greatly appreciated!
Comment #6
vali hutchison commentedThis didn't work for me until i changed ddblock to block and then worked fine: