[drupal-devel] [feature] Let other module use the block matcher

Bèr Kessels drupal-devel at drupal.org
Wed Mar 30 13:33:11 UTC 2005


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

 Project:      Drupal
 Version:      cvs
 Component:    block.module
 Category:     feature requests
 Priority:     normal
 Assigned to:  chx
 Reported by:  chx
 Updated by:   Bèr Kessels
 Status:       patch

A big +1 from me. 
This helps me make sections module a lot smaller and nicer. Sections
module is very popular, but I cannot keep it complelety synchronised
with the blocks regexp code and features, eventgough I get about two of
such requests per week.
It will also allow us to:
* Make that proposed admin theme a lot easier and nicer to code.
* Allow very fancy themes (i.e. show a banner on foo and bar only)
* Allow modules to easily check for its location (we now have loads of
if($_GET['q'] = foo) in code. They can now use an easy API.
* Do any other easy WhereAmI checks. We offer no such locator API atm.
The implementation is really easy, simple and changes hardly anything. 
Also, this patch will make a more regions implemtation a lot easier,
this patch can even be seen as the first step towards that.
Bèr


Bèr Kessels



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

March 30, 2005 - 13:43 : chx

Attachment: http://drupal.org/files/issues/blocks_regions.patch (1.74 KB)

This patch makes sure that block.module deals by default only with
regions 0 and 1 as it does now but lets you use block_list with any
region you define. This opens many possibilites. You may do a multi
region module, with your admin UI using the blocks table as storage and
the block_list matcher. Or you may do a sections module using the block
matcher without cluttering the current blocks list.
block_list has a phpdoc: * @param $region main|left|right but I have
not found anything regarding 'main' so I changed this to left|right|all
where all means (left or right). As the current block module would treat
'main' the same as 'right' I doubt it had any usage.
In short: no functionality is harmed, lots of possibilities are opened,
so please commit.





More information about the drupal-devel mailing list