Displays weather forecast for a selected location in frontend based on wetter.com openweather API
Open Issues: 0
- php: ^7.4 || ^8.0 || ^8.1
- typo3/cms-core: ^10.4.20 || ^11.5
- typo3-ter/openweatherapi: 3.2.0
Displays weather forecast for a selected location in frontend based on api.wetter.com (openweather API).
- This extension is based on the free XML API that was/is provided by api.wetter.com directly.
- Wetter.com does not offer the XML API to new customers. The admin interface on the website is not available any more. The API endpoints seem to be still active for existing subscriptions.
- As announced here https://www.wetter.com/apps_und_mehr/website/api/ (12/2020): wetter.com offers a new REST API via Rapid API. This extension does not support this new REST API yet.
The extension needs to be installed as any other extension of TYPO3 CMS. Get the extension
- Get it from the Extension Manager: Press the Retrieve/Update button and search for the extension key
openweatherapiand import the extension from the repository.
- Get it from typo3.org: You can always get current version from https://extensions.typo3.org/extension/openweatherapi/ by downloading either the t3x or zip version. Upload the file afterwards in the Extension Manager.
The extension ships some TypoScript code which needs to be included and configured.
- Switch to the root page of your site.
- Switch to the Template module and select Info/Modify.
- Press the link Edit the whole template record and switch to the tab Includes.
- Select Openweather API - Weather Forecast at the field Include static (from extensions).
Creating a Plugin Content Element
To show the weather forecast on a page:
- Switch to the Page view module
- Create a new page or select an existing page
- Create a new content element and in the “new content element wizard” scroll down to the plugins section and select “Weather Forecast”
- Switch to the Plugin tab, and enter the required fields based on your wetter.com API subscription:
- Project Name
- API Key
- City Code
- Save the new plugin configuration.
- Switch to the frontend and validate if the plugin is working correctly.
- When you open the frontend page with the plugin for the first time or after a change on the page, the API call to wetter.com is performed and data is fetched.
- When you or another user loads the same page again, the API call is not performed again, since the content is already cached in Typo3 CMS.
- The API will be called again after page cache expired (e.g. after 24 h). You can finetune the caching behaviour and API reloads. Edit the page record and switch to "Behaviour" tab. Select the proper setting in field "Caching/Cache lifetime"
To customize the frontend output, define your own template and overwrite the template path in the constants section of the template module:
To customize date / time formats, overwrite the Typoscript setting in the setup section of the template module:
plugin.tx_openweatherapi.settings.strftime = %A, %d.%m.%Y