Weather Widget
Installation
Create a widget instance by embedding the following code within your webpage inside the <body> element:
<div id="Bs-WeatherWidget"></div>
<script
id="booking-suedtirol-js"
src="https://widget.bookingsuedtirol.com/v2/bundle.js"
defer
></script>
<script>
document
.querySelector("#booking-suedtirol-js")
.addEventListener("load", () => {
BookingSüdtirol.Widgets.Weather("#Bs-WeatherWidget", {
id: undefined,
propertyId: undefined,
lang: "de",
});
});
</script>
Include the script element with src="https://widget.bookingsuedtirol.com/v2/bundle.js" from the code above exactly as specified. Do not self-host a copy of the script and do not include its code into a self-hosted JavaScript bundle file. If you do, the widget will not work correctly.
Configuration
Use BookingSüdtirol.Widgets.Weather(domElement, settings) to create new widget instances.
Method arguments
domElement: string | DOM element
The CSS selector or DOM element where your widget will be mounted.
settings: object
Initialization options. See API below. Each widget instance can have it's own settings.
URL parameters
The following list of settings can also be passed over the URL.
propertyIdlang
Notice that URL parameters always overwrite widget instance settings.
API
id: string
The widget ID
Mandatory field
propertyId: number
ID of the property/accommodation
Mandatory field. The property must already have been activated for the widget.
accommodationId: number
accommodationIdDeprecated. Use propertyId instead.
lang: string?
Language
de: German (default)it: Italianen: English
districtId: number?
Detailed six day forecast for the various districts of South Tyrol.
1: Bolzano, Überetsch and Unterland2: Burggrafenamt - Meran and surroundings3: Vinschgau4: Eisacktal and Sarntal5: Wipptal - Sterzing and surroundings6: Pustertal7: Ladinia - Dolomites
iconStyle: string?
Choose between different icon styles
colored(Default)monochrome
source: string?
Enables the widget to be installed on portals with multiple properties. For this functionality, please contact support directly.
Events
This widget does not fire any events.