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

mlsamuelson’s picture

Andre,

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.

capellic’s picture

I 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.

mlsamuelson’s picture

Version: 5.x-1.x-dev » 6.x-1.x-dev
Status: Active » Fixed

Updated the README.txt for 6--1 and HEAD versions of the module.

Thanks.

mlsamuelson

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

  • Commit f8463f1 on master, 8.x by mlsamuelson:
    #168020 thanks aangel - updating README.txt so, ahem, people know how to...
  • Commit 8b91cd0 on 6.x-1.x, 8.x by mlsamuelson:
    committing for 6--1 #168020 - updating README.txt so, ahem, people know...

  • Commit f8463f1 on master, 8.x, 8.x-1.x by mlsamuelson:
    #168020 thanks aangel - updating README.txt so, ahem, people know how to...
  • Commit 8b91cd0 on 6.x-1.x, 8.x, 8.x-1.x by mlsamuelson:
    committing for 6--1 #168020 - updating README.txt so, ahem, people know...