-
Notifications
You must be signed in to change notification settings - Fork 33
Manage City Forecasts
Grace Amondi edited this page Apr 24, 2023
·
8 revisions

City forecasts displayed on the homepage, and forecasts page can be added through the CMS in two ways:
- Manually adding daily forecasts
- Fetching city forecasts from an external source i.e YR Meteo Norway's location forecast API https://developer.yr.no/featured-products/forecast/
The city forecast explorer menu can be accessed on the left sidebar.

Here you have the ability to:
- Add/Edit/Delete a city (city name and location)

- Add/Edit/Delete a weather condition (condition name, icon and description). Please refer to YR Weather symbols documentation for guidance on icons and naming convention. https://api.met.no/weatherapi/weathericon/2.0/documentation

- Add/Edit a forecast. Optionally, you can download the table as CSV, edit it offline and paste the values to the online table and submit. Ensure to fix all validation error raised before submitting.

- Query historical forecasts. By selecting query forecasts on the top left dropdown, it is possible to retrieve past forecasts and download by city and date range. This could also provides a quick shortcut for creating a future forecasts.

Creating a forecast for an already existing date will overwrite the values in the database hence can be used a technique of updating existing records.
To enable automated fetching of city forecasts from an external source i.e YR Meteo Norway's location forecast API https://developer.yr.no/featured-products/forecast/, this option needs to be set to true.
The forecast will be fetched every three hours and get updated accordingly.