| Introducing the Z Weather Plugin |
|
|
|
| Sunday, 05 October 2008 18:50 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The Z Weather plugin (or mambot in Joomla 1.0) is a new way in version 6 of Z Weather to display weather information on your website, by directly displaying the weather information within your content articles or through a custom HTML module. The plugin has access to over 50 weather data items, including multiple period data in the forecast data items.At the end of this articleis a list of the Z Weather variables supported by the plugin, which is data directly from the XML dataof the National Weather Service.
The syntax for using the plugin is: {zweather var=var_name,key=val,loc=id} The "var" field is required, but the "key" and "loc" fields are optional. When specifying more than one field, separate them with the comma character, ",". The "var" field specifies one of the plugin variables listed at the end of this article. The "key" field specifies a period value if a variable has more than one period (multi-day values, for example). The "loc" field is used to specify the location id if multiple Z Weather locations are being used. If the "loc" field is not specified, the default Z Weather location is used. ExamplesIf you wish to display the currently observed weather conditions (i.e. sunny, cloudy) for the default weather location, for example, you would enter the following in your article: {zweather var=o_weather} If you wish 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}, Low temperature: {zweather var=f24_mintemp} If you wish to display the weather forecast for today and tomorrow, you would use the "key" setting to set the period #: Today's Forecast: {zweather var=f24_weather,key=0}, Tomorrow's forecast: {zweather var=f24_weather,key=1} When no "key" setting is set, the first key value, "0", is used. If you are working with multiple locations, use the "loc" setting to specify the specific location id instead of using the default location. For example, to display the weather forecast for location id=1: Weather forecast for New York, NY: {zweather var=f24_weather,loc=1} When no "loc" setting is specified, the default location is used. The default location is set in the administrator screen. Look for more examples in the Z Weather plugin examples article, which includes the code from the examples that you can copy and modify for your own site. Z Weather Plugin VariablesThe variables described below are used in the "var" field for the plugin. All plugin variables, except for the observation variables, support multiple keys. The forecast variables use multiple keys for multiple weather periods. The alert variables use multiple keys when multiple alerts have been posted for the local region.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Last Updated on Thursday, 09 October 2008 09:48 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||



