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

Dries drupal-devel at drupal.org
Sun Apr 3 21:26:01 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:   Dries
 Status:       patch

I have problems understanding the following sentence: "You may use this
function for anything that needs a node type or a URL matcher.". 
People not familiar with the function won't understand what is meant
with "a node type or a URL matcher".  I happen to understand this, yet
I don't understand what is meant with "anything"?  Is the documentation
for @return still current?  Do people understand what is meant with
"region"?  IMO, this function's PHPdoc is still somewhat


Previous comments:

March 30, 2005 - 14: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.


March 30, 2005 - 15:33 : Bèr Kessels

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.


April 3, 2005 - 21:58 : chx

Attachment: http://drupal.org/files/issues/block_regions.patch (2.92 KB)

More phpdoc. Proper CVS diff.

More information about the drupal-devel mailing list