theming

Theme the AHAH progress animation

 

Having a hard time to catch the Drupal AHAH animation in Firebug? This is how it looks like. Add it after your button in Edit, and now you can style it.

 

<?php
<input type="submit" name="op" value="Go" class="form-submit ahah-processed progress-disabled" id="edit-go">
<
div class="ahah-progress ahah-progress-throbber" style="display: block;">
<
div class="throbber">&nbsp;</div>
</
div>
?>

 

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.