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

J-P Stacey jp.stacey at torchbox.com
Wed Apr 11 15:48:02 UTC 2007


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


More information about the support mailing list