The Zap Weather plugin is a way to display customized weather information on your website.  With this plugin, weather information can be displayed either within an article or from a custom HTML module. The plugin has access to over 50 weather data items, including multiple period data in the forecast data items.

 

To use this feature, the Zap Weather plugin must be installed and enabled, which is located in the content plugin folder.  To use this in an article or custom HTML module, use the following syntax:

{_zweather var=var_name,index=val,loc=id,tformat=fmt}

Fields

var - The name of the weather variable to be displayed (see below for list of valid variables

index - The index value of a variable if there are multiple data items (multi-day values, for example)

loc - Specify the location id to be used for retrieving the weather data (the id as shown in the location manager in the back-end).  If not used, the previous location specified will be used. If no previous location was ever specified, then the first location (lowest id) will be used.

tformat - If the weather variable displays a date/time value, specify a format string as specified PHP's strftime command.  This option looks at the timezone setting in Joomla's global settings to format the date/time to the local time zone.

Examples

To display the currently observed weather conditions (i.e. sunny, cloudy) for location 1, for example, you would enter the following in your article:

{_zweather var=o_weather,loc=1}

To display the maximum and minimum temperatures for today's forecast, you would use the 24 hour forecast variables f24_maxtemp and f24_mintemp, respectively:

High temperature: {_zweather var=f24_maxtemp,loc=1}%deg;, Low temperature: {_zweather var=f24_mintemp,loc=1}%deg;

If you wish to display the weather forecast for today and tomorrow, you would use the "index" setting to set the period #:

Today's Forecast: {_zweather var=f24_weather,loc=1,index=0}, Tomorrow's forecast: {_zweather var=f24_weather,loc=1,index=1}

When no "index" setting is set, "0" is used.

You only need to set the location once when working with a single location.  This eliminates the need to specify the location for every variable and also allows one to easily change to another location by changing only one value.  For example, this will show the high and low temperature for location 2:

{_zweather loc=2}{_zweather var=f24_maxtemp}%deg;/{_zweather var=f24_mintemp}%deg;

To switch to another location, change the "2" to another value.

The tformat command will format a date/time value using the PHP strftime command.

Look for more examples in the Zap Weather plugin examples article, which includes code that can be pasted into an article or custom HTML module.

Zap Weather Plugin Variables

The variables described below are used in the "var" field for the plugin. All forecast variables use index values for multiple weather periods (i.e, for 24 hour variables, index 0 is today, index 1 is tomorrow, index 2 is the following day, etc.).  Alert variables use index values when multiple alerts have been posted for the local region.  Observation variables do not use index values.

 

Variable NameDescription
24 Hour Variables
f24_lastupdate last weather update time
f24_maxtemp maximum temperature
f24_mintemp maximum temperature
f24_tempunit temperature unit
f24_weather weather condition
f24_icon weather icon
f24_starttime period starting time
f24_endtime period ending time
f24_pop probability of precipitation in 12 hr incr.
   
12 Hour Variables
f12_lastupdate last weather update time
f12_maxtemp maximum temperature
f12_mintemp maximum temperature
f12_tempunit temperature unit
f12_weather weather condition
f12_icon weather icon
f12_starttime period starting time
f12_endtime period ending time
f12_pop probability of precipitation in 12 hr incr.
f12_periodname period name
   
3 Hour Variables
f3_lastupdate last weather update time
f3_temp hourly temperature
f3_tempunit temperature unit
f3_apptemp apparent temperature
f3_icon weather icon
f3_starttime period starting time
f3_weather weather condition
f3_weatheri weather intensity
f3_weatherq weather qualifier
f3_weathera additional weather condition
f3_weatherai additional weather intensity
f3_weatheraq additional weather qualifier
   
Observation Variables
o_location location
o_stationid station id
o_latitude station latitude
o_longitude station longitude
o_timestr observation time
o_time822 observation time in RF822 format
o_weather observation weather
o_tempf observation temperature in farenheit
o_tempc observation temperature in celcius
o_tempstr observation temperature string
o_heatindexf observation heat index in farenheit
o_heatindexc observation heat index in celcius
o_heatindexstr observation heat index string
o_windchillf wind chill in farenheit
o_windchillc wind chill in celcius
o_windchillstr wind chill string
o_pressuremb barometric pressure in mb
o_pressurein barometric pressure in in
o_pressurestr barometric pressure string
o_humidity relative humidity
o_windstr wind string
o_windir wind direction
o_visibility visibility in miles
o_iconbase icon path
o_iconname icon file name
   
Alert Variables
a_description alert description
a_title alert title
a_link alert link