Remote blocks

At Pronovix we've been thinking about distributed service systems. I was asked to do some background/proof of concept research, and after one day, here is the first experimental module, called remote blocks.
The first thing what I want to say about this module, is that the access control is currently omitted, because I haven't find a really easy and clean way to do it (something what works in 5 minutes).
On the first screenshot, you can see the module's admin interface in my Drupal sandbox.
![]()
Currently there isn't so much setting here. But here you can enable the server mode, so that other sites where remoteblocks are enabled, can pull data from your site. It can be a better solution to refactor this functionality to a different module, but now it is OK.
![]()
This is where you can add block to your site. If your JavaScript is turned off, then you will have 3 textfields (URL, module, delta). If JavaScript is on, then it hides the module and delta textfield (as you can see on the screenshot), and based on the URL, it asks the remote block server of the available modules and deltas.
![]()
As you can see, it is really easy to set it up. It may makes sense to remove completely the module part, and put all available delta into one list, but this is rather an usability issue than a technical one.
![]()
After you have added the block, you can edit or delete it under the "List" tab. The delta is represented by a number, because currently I don't store the $block['info'] in the database.
![]()
If you go the admin/build/block page, you can see the new block.
![]()
This is where the remote block is enabled, and it fetches data from a different site (in this screenshot actually it fetches from the same site, because I was lazy to set up a new site).
I hope that I can do some further experiments in this exciting new area.
The module is published on Drupal.org: http://drupal.org/project/remoteblocks
| Attachment | Size |
|---|---|
| shot10.png | 86.49 KB |
| shot10_thumb.png | 31.96 KB |
| shot11.png | 86.1 KB |
| shot11_thumb.png | 31.66 KB |
| shot12.png | 89.61 KB |
| shot12_thumb.png | 33.06 KB |
| shot13.png | 87.6 KB |
| shot13_thumb.png | 32.63 KB |
| shot14.png | 121.28 KB |
| shot14_thumb.png | 53.26 KB |
| shot15.png | 99.43 KB |
| shot15_thumb.png | 45.95 KB |









How hard would it be to extend this technique to remote nodes?
Remote node loading would not be too hard, it gets more 'interesting' when the comments have to be posted on the third party site. Although that there are implementation patterns for that in modules like http://drupal.org/project/com2vb
So you could just use links to the forms on the other site.
Thanks for replying! I am building an estimate for building several drupal sites where several content types are shared (i.e. content from site a can be used in views on site b) but otherwise the sites are completely separate.
I know about the domain access module that allows you to act like a single drupal site is more than one drupal site depending on what url it was called from, but that limits you to a single structure for these "multiple sites". I.E. http://site_a.com/aboutus and http://site_b.com/aboutus go to the same content, which is a bit limiting for pages and potentially worse for callbacks. There may be lots of other coding you need to do to make particular callbacks change their behavior based on domain. Sitemaps don't work and panels only are domain aware in D7 for instance (to my knowledge).
There are workarounds for the complexity introduced by domain access, but what I really want is some nodes that can move around between sites rather than a single drupal site with domain specific features and switches. Thus my interest in your module.