[development] finding blocks and getting them simpler.
kb at 2bits.com
Mon May 15 17:02:27 UTC 2006
On 5/15/06, Earl Miles <merlin at logrus.com> wrote:
> Khalid B wrote:
> > On 5/15/06, Earl Miles <merlin at logrus.com> wrote:
> > But, 6 is not portable to other sites. In another site it maybe 1 or 22.
> > So not sure what having it under version control would achieve.
> > If it is:
> > <?php print $region_adsense_top; ?>
> > Or
> > <?php print $region_announce; ?>
> > It is less code, and more descriptive ...
> Not all blocks just use numbers as their deltas; and I've taken to
> naming my deltas so that when more blocks are added, it's more obvious
> what's going on. It'd be nice of Drupal moved toward using descriptive
> deltas rather than simply numbers.
I think that regions solve a major part of that.
It was cool when I added the regions I have to template.php, and the
print $region_id in the page.tpl.php, and saw the yellow markers in
the admin/block screen ...
Think of deltas as the lowest level (block identifiers). On top of that
there are region identifiers. Each region can have one or more blocks
in it. It makes the block delta insignificant.
You can have a region with just one block in it, and do what you wanted
to do with the delta.
regionB -> b1 + b7 + b47
regionX -> b88 + b2
If you decide later that b7 should be in regionX it is just a simple
admin/block change of assigning regionX to b7. That is it. No code
changes or theme changes.
(Not sure if that relates to your versioning thing, but it is a very nice
and useful concept regardless).
More information about the development