Portal Widget

Installation

Create a widget instance by embedding the following code within your webpage inside the <body /> tag:

<div id="Bs-PortalWidget"></div>
<script id="booking-suedtirol-js" src="https://widget.bookingsuedtirol.com/v2/bundle.js" defer></script>
<script>
    document
    .querySelector("#booking-suedtirol-js")
    .addEventListener("load", function() {
        BookingSüdtirol.Widgets.Portal("#Bs-PortalWidget", {
            portalId: 105,
            lang: 'de'
        });
    });
</script>

Please note: Do not include the script in a bundle or host a copy of it yourself.


Configuration

Use BookingSüdtirol.Widgets.Portal(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.

  • lang
  • arrival
  • departure
  • locationId
  • accommodationId
  • guests
  • sortId
  • classificationIds
  • classificationCodes
  • equipmentIds
  • subjectIds
  • showFavorites
  • offset
  • utm_medium
  • utm_source
  • utm_campaign

Notice that URL parameters always overwrite widget instance settings.

// Example
https://www.URL.com/?lang=it&arrival=2021-02-20&departure=2021-02-23&guests=[[18,18],[18,4]]

API

portalId: number

ID of the portal

Mandatory field. The portal must already have been activated for the widget.

lang: string?

Language

  • de: German (default)
  • it: Italian
  • en: English

googleMapsApiKey: string?

This widget optionally uses the Google Maps JavaScript API in order to visualize search results in a comprehensive map view.

For this to work, it is required to create an API Key, that authenticates requests associated with your project for usage and billing purposes.

arrival: string?

Defines the arrival date in ISO 8601 format (yyyy-MM-dd)

2020-02-20

departure: string?

Defines the departure date in ISO 8601 format (yyyy-MM-dd)

2020-02-23

locationId: number?

Searches for a specific location. Note that only locations with associated accommodations are displayed in the widget.

accommodationId: number?

Displays the detail page of a specific accommodation.

guests: number[][]?

Determines the number of rooms and their occupancy in the form of the age of each person.

  • 18: adult
  • 0-17: child
// Examples

// room 1: 2 adults
[[18,18]]

// room 1: 2 adults, 2 children (14 - and 5 years)
[[18,18,14,5]]

// room 1: 2 adults
// room 2: 1 adult, 1 child (4 years)
[[18,18],[18,4]]

// room 1: 2 adults
// room 2: 1 adult
// room 3: 2 adults, 1 child (3 years)
[[18,18],[18],[18,18,3]]

// Produces error because no adults were submitted
[[12]]

// Produces error because more than three rooms were submitted
[[18],[18,14],[18],[18]]

Default value: 2 adults [[18,18]]

Please note: You can add a maximum of three rooms.

sortId: number?

Determines how search results are sorted.

  • 0: Random (default)
  • 1: Category ascending
  • 2: Category descending
  • 3: Price ascending
  • 4: Price descending
  • 5: Rating ascending
  • 6: Rating descending

classificationIds: number[]?

Filter search results by classification.

  • 4: Holiday home
  • 16: Bed and Breakfast
  • 32: Farm holiday
  • 128: Campground
  • 1024: Guest House
  • 15169: Hotel

classificationCodes: number[]?

Filter search results by classification code.

  • 0: Unrated
  • 1: 1
  • 2: 2
  • 3: 3 and 3S
  • 4: 4 and 4S
  • 5: 5

featureIds: number[]?

Filter search results by feature (equipment).

  • 1: garage
  • 2: elevator
  • 4: restaurant
  • 8: fitness
  • 16: spa
  • 256: outdoor pool
  • 512: indoor pool
  • 2048: barrier - free
  • 4096: internet
  • 8192: shuttle Service
  • 16384: child care
  • 16778240: bar
  • 33587200: pet allowed

themeIds: number[]?

Filter search results by theme (subject).

  • 1: family
  • 2: wellness
  • 4: hiking
  • 8: bike
  • 16: cycling
  • 32: golf
  • 64: horseback riding
  • 128: romantic
  • 256: skiing
  • 512: congress possibility
  • 1024: cross country skiing
  • 2048: city / culture
  • 4096: snow shoe

showFavorites: boolean?

Shows or hides bookmarked accommodations.

  • true
  • false (Default)

offset: number?

Controls the current pagination offset.

  • 0: Displays results from 1 to 10
  • 1: Displays results from 11 to 20
  • 2: Displays results from 21 to 30
  • 3...

Events

This widget does not fire any events.