Hi, and thanks for the module. I just implemented it and put together the Readme that would have helped me implement it faster. Any interested in using this readme instead?
-Andre'
------
OVERVIEW
--------
Sidebar blocks contain all sorts of nifty stuff, but sometimes you want to stick that stuff into the body of your node. Instead of using PHP snippets (a possible security hole on public sites), you can use this module. When it's activated...
[block:=]
...will insert the contents of a rendered sidebar block into the body of your node. If no delta is specified, the default block for that module will be displayed.
INSTALLATION
------------
Drop it into your modules folder and turn it on.
Insert Block is intended for use in node content areas only. It works by intercepting the content stream of the node body, detecting that a block request has been made ("[block:=]") and inserting the results of the block you have specified into the HTML stream.
A block must be enabled in /admin/build/block before you can use it.
Determining a Block's Delta
You can determine the "module" and "delta" by going to the /admin/build/block page for administering blocks. In the list of blocks, you'll see a "configure" link for each row. If you hover your mouse over the configure link, and look in the status bar a the bottom of your browser, you'll see a URL similar to the following: http://localhost/admin/build/block/configure/user/0. In that URL, the "user" is the module, and the "0" is the delta. In this instance we're looking at the user login block. If you look at the navigation block, you'll see something like http://localhost/admin/build/block/configure/user/1. Modules can define more than one block, thus the delta is simply a numbering scheme.
In the case of user created blocks, the "block" module will be the owning module. The trick of hovering over the configure links works for these blocks, too.
Custom Blocks
Insert Block also works for custom blocks. If you have a certain piece of HTML or php code that you need in several locations, you can create a custom block and use it repeatedly throughout your site.
Since a custom block must be enabled before Insert Block can use it, you will need to specify a region for it. If you don't want the block to show up in an existing region because it will just get in the way, edit the template.php file and add a new region. See http://drupal.org/node/29139 to learn how to add a region. Use 'floating' => t('Floating Blocks") and add your customer block to this region. If you don't ever modify your template to print the Floating Block region, blocks assigned to that region will be enabled but visible only where you specify them through the [block] tag.
Comments
Comment #1
mlsamuelson commentedAndre,
Thanks for the updated readme.txt.
Before I commit, though, a question:
Has it been your experience that you can only insert blocks if they're enabled? My experience has been otherwise, but I've not rigorously tested this since I began maintaining the project and there may be circumstances (user permissions, etc.) where different rules would apply.
Comment #2
capellicI am using the version for 6 and I did not not have to enable the block - which I was happy to discover.
Thanks for the module.
Comment #3
mlsamuelson commentedUpdated the README.txt for 6--1 and HEAD versions of the module.
Thanks.
mlsamuelson