[support] Templating in Drupal 5.1 - the cleanest way to do it?

Larry Garfield larry at garfieldtech.com
Wed Apr 11 16:18:41 UTC 2007


Yes. :-)  The regions hook defines *block regions only*.  $content is not a block region, and neither are $primary_links nor $secondary_links nor $help, etc.  There's a lot in a page that is not block regions.

If you don't want one of those to show, just don't print them.  

--Larry Garfield

On Wed, 11 Apr 2007 16:48:02 +0100, J-P Stacey <jp.stacey at torchbox.com> wrote:
> Hi again,
> 
> Sorry to respond to my own post: this function does seem to work in
> populate
> the dropdowns at /admin/build/block :
> 
>> 	<?php
>> 	function garlandquux_regions() {
>> 	  return array("fooregion" => t("foo region"); // edit: added entry
>> 	}
>> 	?>
> 
> i.e. any elements returned from the function appear on the dropdown. And
> that seems to work in page.tpl.php, with
> 
> 	<?php print $fooregion ?>
> 
> printing all blocks assigned to that region.
> 
> (I notice the HTML class of the fooregion containing div is "block-region"
> -
> so is a region treated during templating as a special sort of block, a
> superblock?)
> 
> I'm definitely getting there, but the behaviour still seems a bit odd: on
> the one hand there seems to be lots of variables e.g. $primary_links,
> $tabs,
> $title, $help etc. that are handed to page.tpl.php despite not being in
> the
> region list. On the other hand, $content always seems to appear on the
> page
> even if garlandquux_regions() returns an empty array. This seems a bit
> arbitrary - am I missing something?
> 
> Cheers,
> J-P
> --
> [ Drupal support list | http://lists.drupal.org/ ]



More information about the support mailing list