theme

Change theme variables in your module

This is how you can affect variables before sent to theme templates based on the URL. In this case I had to remove an empty sidebar in RootCandy theme.

<?php
/**
 * Implementation of hook_preprocess_page().
 */
function support_filter_preprocess_page(&$vars) {
  if (
arg(0) == "domainuser" OR arg(0) == "support_filter") {
     unset(
$vars['admin_left']);
  }

}
?>

Don't forget to rebuild theme registry by use admin_menu modules Flush all caches > Theme Registry or drupal_rebuild_theme_registry();

Set page template file to use based on content type

If you want to change page.tpl.php to a different one based on the content type you can add a condition in preprocess_page function in your themes template.php file.
Probably you have a phptemplate_preprocess_page() or a [your_theme]_preprocess_page().

<?php
function phptemplate_preprocess_page(&$variables) {

  if (
$variables['node'] && arg(2) != 'edit') {
    
$variables['template_files'][] = 'page-'. $variables['node']->type;
  }
 
}
?>

Then make a copy of page.tpl.php and rename the copy to page-[your-content-type].tpl.php, and make the changes you want.

Customize specific blocks

In your themes block.tpl.php you can add a litle script that converts the title to a class to the wrapping div tag. First add the following in a php section:

<?php
$block_class_title
= 'block-'.strtolower(str_replace(" ", "-", $block->subject));
?>

It will convert "My Title" to "block-my-title".

Pages