Monday, January 11, 2010

Code for footer in Drupal.

Though the author only declared two regions, left and right, he includes the
footer region in the code. This provides us with a good example of the function chameleon_regions() in action. The function defines which regions will be available for the administrator to use for the assignment of blocks. In this case, only left and right are options for the administrator, despite the presence of the footer region in the code. Had the function chameleon_regions() been written so as to include 'footer' => t('footer'), then the region would be accessible to the administrator for block assignment. As it stands, however, the only output of the code below is the footer message, wrapped with a div.
if ($footer = variable_get('site_footer', '')) {
$output .= " <div id=\"footer\">$footer</div>\n";
}

No comments: