jsvisit de

jsWeather offers a solution for preparing generally available weather data and displaying it in a user-friendly way. For this, the easy and safe to use weather application interface (API) from "OpenWeatherMap" is used.

OpenWeatherMap is a commercial online service that provides an interface for retrieving weather data, weather forecasts, and historical weather data for web application and mobile device developers. Some of the available data can be accessed after a registration for free.

With the use of OpenWeatherMap three program developments have been realized:

  • jsWeather php class for simplified use of the OpenWeatherMap API
  • jsWeather - a module for Joomla version 4 and version 5
  • Web application for a weather forecast

 

jsWeather Joomla Module

Weather in New York

19th April, 2024 - 18:34
Overcast Clouds
47°F 45°F min 49°F max
6:11 19:38
Humidity: 77 %
Wind: 17.3 mph North-East
Pressure: 1,021 hPa
Visibility: 32,808 ft
jsWeather is a lightweight and versatile Joomla module that displays weather information for any location, including information such as, humidity, barometric pressure, wind, visibility. It was developed using the latest current version of openWeatherMap as weather data source.
Key features of jsWeather include:

  • An easy-to-use and dynamic display of weather data
  • New: either display of the current weather or a 5-day weather forecast with a line chart showing temperatures
  • Uses weather data provided via a location name, geographical coordinates or the geolocation of visitors.
  • For better performance and system usage, weather data can be cached
  • provides interactive solution using jphpx system extension
  • Latest OpenWeatherMap API support

Weather forecast for London   -  

Weather data from 19th April, 2024 - 0:36

 

19th April, 2024

Light Rain
13°C
Precipitation: 24%
Wind: 21.7 km/h NW
Visibility: 10,000 m
Pressure: 1,017 hPa

20th April, 2024

Broken Clouds
10°C
Precipitation: 0%
Wind: 18.6 km/h N
Visibility: 10,000 m
Pressure: 1,029 hPa

21st April, 2024

Overcast Clouds
9°C
Precipitation: 0%
Wind: 18.0 km/h NE
Visibility: 10,000 m
Pressure: 1,032 hPa

22nd April, 2024

Scattered Clouds
12°C
Precipitation: 0%
Wind: 18.4 km/h NE
Visibility: 10,000 m
Pressure: 1,030 hPa

23rd April, 2024

Overcast Clouds
9°C
Precipitation: 0%
Wind: 10.1 km/h NW
Visibility: 10,000 m
Pressure: 1,023 hPa

[No canvas support]>

1. Installation

You can install the jsWeather Module on your Joomla site using the Install from Web Catalog method because the jsWeather Module is available in the Joomla Extensions database. Or you may download the jsWeather Module installation file from my website and install it via the admin backend.

2. Configuration

To use the module you need to get the free API key from OpenWeatherMap". Then open the setup menu for modules in the Joomla admin backend via "system->site modules" Click the "New button" in the menu and then select the module "jsWeather".
This opens the HTML form for configuring the module. Please use the necessary information for the configuration with the option "Toggle inline help" in the form. This displays help-texts for the respective module settings. Furthermore, take care on the other necessary Joomla settings (e.g. "Position", "Status", Menu assignment, etc.). For example, you can use options to select the "default", "horizontal" ore "forecast" module layouts.

Normally modules are assigned to module positions. These are distributed on the website according to the specifications in the template. Especially for the jsweather module for weather forecasts, it makes sense or is necessary to embed it in a Joomla post (a Joomla article). There are two ways to do this:

  1. the Joomla "loadmodule" content plugin
  2. using the Ajax interface of my system plugin jphpx

 

Jooomla plugin "loadmodule"

The Joomla Core content plugin "loadmodule" allows embedding Joomla modules into Joomal articles.
Since Joomla version 3.9.0, in addition to the plugin alternatives "{loadposition xx}" and "{loadmodule yyy}", there is the variant "{loadmoduleid z}, which is also implemented by the plugin.
In this case, the plugin looks for the module whose id corresponds to the number z. For example, you can insert the module with the "id 200" into the article by inserting the plugin tag "" into the article text.

Application and use

To use the jsWeather module, the following steps must be carried out:
  • Create a jsWeather module via admin backend
    Note: do not assign a module position, leave this undefined.
  • Note (remember) the ID of the module
  • Create/edit a Joomla article
  • Insert the plugin tag "{loadmoduleid x}" ("x" = module ID) into the Joomla article
For the overview section of the jsWeather Module in this article, the same procedure was followed and two modules (one for the current weather and one for a weather forecast) were embedded into the page via loadmodule plugin entries.

jphpx Ajax interface

If the extension "jphpx" is installed, you can implement an interactive solution from jsWeather as an alternative. This makes it possible to request the relevant weather information by entering any weather location. You can see the solution here:


 

 

Installation of the jphpx Ajax interface

The necessary prerequisite is the installation of "jphpx " and the jsWeather Module. With version 1.2. jsWeather also provides all the necessary components for an implementation:

  • html code and scripts for the user interface
  • Scripts for integrating and rendering the modules in the Joomla article

Configure solution

The following steps are necessary for a successful implementation:


  1. Create 2 jsweather modules, one for the current weather (Module Type "current Weather" and one for the weather forecast (Module Type "Weather Forecast").
    Note: do not assign module positions, leave these undefined. Write down (remember) the titles of these two modules (the titles should not contain any spaces or special characters)

     


  2. Using the “Components” menu item in the administrator backend, you select the “jphpx Application” or “jphpx Code Entry” option. This calls the component and you can now define a new jphpx application using the “New” button. Define the code source with the value
    "modules/mod_js_weather/load_jsweather.php". After saving, write down (remember) the "id" of the new jphpx code entry.

     


  3. The runtime parameters are used to customize the HTML code and scripts for the user interface. To do this, edit the file: jphpx_loadmodule.ini stored in directory
    "../modules/mod_js_weather". To may do this, using the editing function of the FTP client “Fillezilla” or a similar tool. The meanings of the parameters are provided in the file. The following settings must be changed to your configured values of modules and jphpx component.
    • "id" - jphpx Code Entry Id
    • "current" - Title of the module type "current weather"
    • "forecast" - Title of the module type "weather forecast"

     


  4. Finally, enter this jphpx plugin tag
    "{jphpx [modules/mod_js_weather/jphpx_loadmodule.php]}"
    at the location of your Joomla article where the jsWeather modules should be rendered.

Notes

With version 1.1.5 you may use owfont, which is a symbol font for Open Weather Map API. owfont is designed to match to weather condition codes returned by OpenWeatherMap API. It uses the response code as class name (prefixed with owf) and displays the related weather icon.

When using geolocation servers, an attempt is made to deliver the geographic coordinates via the website visitor's Internet address. However, this location allocation can only be as accurate as the respective data provided by the internet providers. IP-based geolocation services can be expected to provide 55 to 80 percent accuracy for a user's region or state.

Weather data are never "precise" they always relate to a more or less large region. It is therefore quite possible that e.g. rain is displayed although there is no rain in sight at the selected location.

If you get a "400" error when entering a valid location, you should enter the place name in lower case and then try the request again. If this also leads to the same error, enter the geographic coordinates of the location.

 

Download jsWeather

jsWeather is free software (like Joomla!) - however you must follow the GPL license terms to use it. More about GPL and free software can be found at GNU Org.

To download jsWeather click the "download" image:

downloadjsWeather module version 1.2 for Joomla!

Any questions? Visit the Support Forum or send an email to the developer, our webmaster.

Visitors

Today: 70
Yesterday: 33
This Week: 219
Last Week: 590
This Month: 1,342
Last Month: 2,235
This Year: 6,707
Total: 239,300
0239300
Germany 30.9% Germany
USA 22.8% USA
France 3.3% France
Italy 2.7% Italy
Indonesia 2.1% Indonesia
Poland 2.0% Poland
Netherlands 1.8% Netherlands

Total:

209

Countries
We use cookies

We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.