I have installed and had the weather module working perfectly as a block. When I try to overide weather.tpl.php by copying into my theme folder block-weather.tpl.php, the entire block is missing. I am using a Zen subtheme and have the block.tpl.php file included in the folder as well.

Comments

sakins’s picture

anyone?

cwebster’s picture

Status: Active » Reviewed & tested by the community

In weather.module, the following function is declared:

/**
 * Implement hook_theme().
 */
function weather_theme() {
  return array(
    // Custom theme function for preprocessing variables
    'weather_theming' => array(
      'file' => 'weather_theme.inc',
      'variables' => array('display' => NULL, 'location' => NULL, 'metar' => NULL),
    ),
    // Default block layout
    'weather' => array(
      'template' => 'weather',
      'variables' => array('weather' => NULL),
    ),
    // Compact block layout
    'weather_compact' => array(
      'template' => 'weather_compact',
      'variables' => array('weather' => NULL),
    ),
  );

Based on that, you can just copy weather.tpl.php or weather_compact.tpl.php (depending on which display you need) from the weather module folder to your theme directory. No renaming should be necessary— just remember to flush your caches. (Tested in Drupal 7)

toddy’s picture

Status: Reviewed & tested by the community » Closed (fixed)