[drupal-devel] [feature] Enable multiple block regions (not just "left" and "right" sidebars)

nedjo drupal-devel at drupal.org
Sun Apr 17 01:05:05 UTC 2005


Issue status update for http://drupal.org/node/16216

 Project:      Drupal
 Version:      cvs
 Component:    block.module
 Category:     feature requests
 Priority:     normal
 Assigned to:  Anonymous
 Reported by:  paragkenia
 Updated by:   nedjo
 Status:       patch
 Attachment:   http://drupal.org/files/issues/block_regions.png (5.65 KB)

Here's a screenshot showing the  block admin page, with drop-downs for
region placement (the options are dynamically generated based on
defined regions).




nedjo



Previous comments:
------------------------------------------------------------------------

January 26, 2005 - 06:27 : paragkenia

I read the comparision discussion between *Drupal* and *Mambo*. In
several messages it was outlined that Drupal can place blocks only in
right and left and not flexible to put them on anywhere where one want.
It will be great if this can be changed in upcoming versions.


I am no pro at PHP, so don't know how much time this task will take,
but I think it is very important.


parag




------------------------------------------------------------------------

April 14, 2005 - 21:44 : nedjo

This issue was apparently partially addressed in issue
http://drupal.org/node/19694 [1].
[1] http://drupal.org/node/19694




------------------------------------------------------------------------

April 16, 2005 - 20:24 : nedjo

Attachment: http://drupal.org/files/issues/block-dynamic-regions.patch (8.17 KB)

This much-requested functionality - to have the ability to place blocks
in more than the two predefined regions - was partially addressed in
issue http://drupal.org/node/19694. [2].  But "blocks" are still
limited to the "left" and "right" sidebars (hard-coded in
block.module). 


This patch is a first step designed to enable multiple (eventually,
admin-definable) regions for blocks.  I've moved the existing "left"
and "right" block regions to a 'region' table (with ids of 0 and 1, as
currently used in themes).  Then all references to the regions are
drawn dynamically from the table.  This way, if further records are
added, they will appear in the list of available regions for block
placement.


Doing this actually reduces some duplicated code, since it's no longer
necessary to repeat code blocks for each of "left" and "right".


As it stands, the patch doesn't add any new functionality--but I don't
think it breaks anything either.  New functionality would need (a) new
regions defined, and (b) changes to themes.  A simple first step might
be, e.g., to add a "footer" region and then add a call in the footer
generation to append any blocks assigned to the footer region there.


I'm setting this to patch, but I'm aware that it needs some discussion
and refining before it'll be ready to apply.
[2] http://drupal.org/node/19694.







More information about the drupal-devel mailing list