More regions (was Re: [drupal-devel] [task] Typo on block admin page)
Bèr Kessels
berdrupal at tiscali.be
Mon Mar 7 06:42:37 UTC 2005
Op maandag 7 maart 2005 00:11, schreef Steven Wittens:
> The big roadblock for custom theme regions is having multiple themes per
> site. This is a valid use case (sections.module, or even a 'mobile'
> theme for PDA/Cell phones). I'd suggest you check out some earlier
> discussions on this in the archives.
This indeed is a problem. But can we not tackle it right here and now?
My proposal:
1) a theme registers all its regions by returning an array from a called
hook_regions. These should be choosed from a documented lists of "suggested
good defaults".
2) the engine caches these, in a smart way: private (only in theme X), globals
(in more than one theme), leftovers (only in one theme, not the same as
private).
3) The UI presents these regions, overlapping is solved. (eg box_grey gives
"header" and so does friendseletric, we should have only one "header"). The
UI has a flag to define a *default* region.
4) The regions are now iterated as follows:
4.1) Global regions are filled by engine and cached per role and engine. (like
now)
4.2) Private regions are filled by theme and cached per role and theme
4.3) Leftovers are appended to the default region and cached per role and
theme
5) theme_page($content, $region='all') collects all these strings either from
cache or from a rebuild, and returns them as HTML.
$region can be 'all' (same as now) or $region ='none' only content area is
returned (for popups, and performance!) or a string (I can see some nice uses
for this, but ATM not yet used) ($region=header, to print only the header
area) or $region ='none'.
The naming has been discussed on drupal.org a lot already.
I think, that if we agree on this issue Steven raises, we have more then
enough said and documented to make up a nice program of demands for this
module. Only thing is that we then need to find someone with ten fingers (or
less) and a brain with some PHP and Drupal code in it, to actually make it.
Hell, I might even volunteer for this, but I have to ask my client first. :)
Regards,
Bèr
--
[ Bèr Kessels | Drupal services www.webschuur.com ]
More information about the drupal-devel
mailing list