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

 

jsWeather Joomla Module

Weather in New York

22nd May, 2024 - 13:28
Clear Sky
83°F 73°F min 91°F max
5:32 20:12
Humidity: 52 %
Wind: 13.8 mph South-East
Pressure: 1,015 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 22nd May, 2024 - 19:32

 

23rd May, 2024

Broken Clouds
17°C
Precipitation: 0%
Wind: 16.8 km/h W
Visibility: 10,000 m
Pressure: 1,015 hPa

24th May, 2024

Scattered Clouds
18°C
Precipitation: 0%
Wind: 6.9 km/h SW
Visibility: 10,000 m
Pressure: 1,019 hPa

25th May, 2024

Clear Sky
21°C
Precipitation: 0%
Wind: 1.7 km/h E
Visibility: 10,000 m
Pressure: 1,018 hPa

26th May, 2024

Light Rain
15°C
Precipitation: 100%
Wind: 6.5 km/h S
Visibility: 10,000 m
Pressure: 1,016 hPa

27th May, 2024

Light Rain
18°C
Precipitation: 20%
Wind: 14.3 km/h W
Visibility: 10,000 m
Pressure: 1,019 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: 62
Yesterday: 76
This Week: 207
Last Week: 436
This Month: 1,365
Last Month: 1,841
This Year: 8,571
Total: 241,164
0241164
Germany 31.2% Germany
USA 22.6% USA
France 3.3% France
Italy 2.7% Italy
Indonesia 2.1% Indonesia
Poland 2.0% Poland

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.