How do I show the weather block based on Geofield on a Taxonomy Term The Weather module has a block to show weather based on IPs on a node defined by the geofield module. There doesn't seem to support if it is on a taxonomy term. How can I modify this code to support taxonomy terms?

   case 'geofield':
  if (user_access('access content')) {
    // Set up the node geofield weather block.
    if (arg(0) == 'node' and is_numeric(arg(1))) {
      $node = node_load(arg(1));
      $block['subject'] = t('Weather nearby');
      $block['content'] = '';
      $display = weather_get_display_config('default');
      $display-&gt;detailed = FALSE;
      // Get a list of all field names which are geofield fields.
      $geofield_field_names = db_select('field_config', 'fc')
        -&gt;fields('fc', array('field_name'))
        -&gt;condition('type', 'geofield', '=')
        -&gt;execute()
        -&gt;fetchCol();
      foreach ($geofield_field_names as $geofield_field_name) {
        if (isset($node-&gt;$geofield_field_name)) {
          // The node has geofield fields, determine if there's usable data.
          // First cycle through the language codes (will mostly be 'und').
          foreach ($node-&gt;$geofield_field_name as $language) {
            // Now cycle through the different locations.
            foreach ($language as $location) {
              if (($location['lat'] != 0) or ($location['lon'] != 0)) {
                $place = weather_get_nearest_station($location['lat'], $location['lon']);
                $forecasts = weather_get_weather($place-&gt;geoid, $forecast_days, $display-&gt;detailed);
                $weather[0]['forecasts'] = $forecasts['forecasts'];
                $weather[0]['utc_offset'] = $forecasts['utc_offset'];
                $weather[0]['name'] = $place-&gt;displayed_name;
                $weather[0]['geoid'] = $place-&gt;geoid;
                $link = _weather_get_link_for_geoid($place-&gt;geoid, 'default');
                $weather[0]['link'] = l($place-&gt;displayed_name, $link);
                $link = _weather_get_link_for_geoid($place-&gt;geoid, 'yr.no');
                $weather[0]['yr.no'] = $link;
                $weather[0]['station'] = array('distance' =&gt; $place-&gt;distance, 'bearing' =&gt; $place-&gt;bearing);
                $block['content'] = theme('weather_forecast_preprocess',
                  array('weather' =&gt; $weather, 'display' =&gt; $display));
              }
            }
          }
        }
      }
      // Do not show block if no lat/long information has been found.
      if (empty($block['content'])) {
        return;
      }
    }
  }
Here's a stab at it. You'll obviously need to test as I haven't tested it at all. Basically I added in some checks to see if it was a node or a term and then tried to test the fields for either one. Let me know if it helps!

 case 'geofield':
    if (user_access('access content')) {
        // Set up the node geofield weather block.
        if (arg(0) == 'node' and is_numeric(arg(1))) {
            $node = node_load(arg(1));
        } else if (arg(0) == 'taxonomy' &amp;&amp; arg(1) == 'term' &amp;&amp; is_numeric(arg(2))) {
            $term = taxonomy_term_load(arg(2));
        }

        $block['subject'] = t('Weather nearby');
        $block['content'] = '';
        $display = weather_get_display_config('default');
        $display-&gt;detailed = FALSE;
        // Get a list of all field names which are geofield fields.
        $geofield_field_names = db_select('field_config', 'fc')
            -&gt;fields('fc', array('field_name'))
            -&gt;condition('type', 'geofield', '=')
            -&gt;execute()
            -&gt;fetchCol();
        foreach ($geofield_field_names as $geofield_field_name) {
            $geofieldname = array();
            if (isset($node-&gt;$geofield_field_name)) {
                $geofieldname = $node-&gt;$geofield_field_name;
            } else if (isset($term-&gt;$geofield_field_name)) {
                $geofieldname = $term-&gt;$geofield_field_name;
            } 

            if (!empty($geofieldname)) {
                // The node/term has geofield fields, determine if there's usable data.
                // First cycle through the language codes (will mostly be 'und').
                foreach ($geofieldname as $language) {
                    // Now cycle through the different locations.
                    foreach ($language as $location) {
                        if (($location['lat'] != 0) or ($location['lon'] != 0)) {
                            $place = weather_get_nearest_station($location['lat'], $location['lon']);
                            $forecasts = weather_get_weather($place-&gt;geoid, $forecast_days, $display-&gt;detailed);
                            $weather[0]['forecasts'] = $forecasts['forecasts'];
                            $weather[0]['utc_offset'] = $forecasts['utc_offset'];
                            $weather[0]['name'] = $place-&gt;displayed_name;
                            $weather[0]['geoid'] = $place-&gt;geoid;
                            $link = _weather_get_link_for_geoid($place-&gt;geoid, 'default');
                            $weather[0]['link'] = l($place-&gt;displayed_name, $link);
                            $link = _weather_get_link_for_geoid($place-&gt;geoid, 'yr.no');
                            $weather[0]['yr.no'] = $link;
                            $weather[0]['station'] = array('distance' =&gt; $place-&gt;distance, 'bearing' =&gt; $place-&gt;bearing);
                            $block['content'] = theme('weather_forecast_preprocess',
                                array('weather' =&gt; $weather, 'display' =&gt; $display));
                        }
                    }
                }
            }
            unset($geofieldname);
        }

        // Do not show block if no lat/long information has been found.
        if (empty($block['content'])) {
            return;
        }


    }