The Rooms Panel Component
Description
How to integrate the rooms panel on your website
Description
How to integrate the rooms panel on your website
First, if you want to load the rooms panel component through cotton-ball, you need to load the cotton-ball as following:
<script type="text/javascript" src="https://api.tui.com/ml/cotton-ball/"></script>
Then you need to load the rooms panel component:
<div class="tui-component tui-component-rooms-panel"></div>
Example:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Rooms Panel</title>
<script type="text/javascript" src="https://api.tui.com/ml/cotton-ball/"></script>
</head>
<body>
<div
class="tui-component tui-component-rooms-panel"
data-tenancy="TUICOM"
data-price-format="de"
></div>
</body>
</html>
Screenshots
Variants of the Rooms Panel.
Meta
Maintainer | picr-developmentb2c-tuicom@tui.com |
---|---|
Locales |
de-DE , en-GB
|
Usage
Add the following script tag (or something similar) to your web page to have the component load. Note: This is required only once per webpage, even when you embed multiple instances of the component.
<script src="https://api.tui.com/ml/rooms-panel/ui/" async defer></script>
Add the following HTML code anywhere in your webpage at the position where you want the component to show. You can create multiple instances of the component.
Remember to replace VALUE
with actual valid values for the given attribute.
<div class="tui-component tui-component-tui-rooms-panel"
data-lang="VALUE"
data-tenancy="VALUE"
data-event-scope="VALUE"
data-price-format="VALUE"
data-giata-id="VALUE">
</div>
ATTENTION: This is a legacy component. The tag name must be set as class name (as in the example above), and attributes must be prefixed with data-
.
Read more about using components ›
Attributes
This component can be configured with the following attributes:
Name | Description | Allowed Values | Default | Required |
---|---|---|---|---|
lang |
Set one of the following language. |
de_DE , en_GB
|
de_DE |
yes |
tenancy |
The Peakwork player for this set. |
TUICOM
|
TUICOM |
yes |
event-scope |
All events the rooms panel fires itself will carry this scope. In addition if you want to fire events to a specific rooms panel you can use its event scope. |
yes | ||
price-format |
Set the initial value for the price format. |
de , ch
|
yes | |
selection-type |
To configure the view to select one or multiple rooms. If not set default is: single |
single , multiple
|
single |
no |
giata-id |
To configure which rooms are shown in the rooms panel and are available for the hotel. |
yes | ||
search-scope |
To configure the travel type. |
PACKAGE , HOTEL
|
HOTEL |
no |
price-type |
To configure the price types. |
TOTAL , PER_PERSON
|
PER_PERSON |
no |
show-price |
To configure the view of the price. |
true , false
|
true |
no |
show-image |
To configure if image should be shown or not. |
true , false
|
true |
no |
filter-rooms-without-image |
To filter the rooms with no images. |
true , false
|
false |
no |
show-global-types |
To configure if global types should be shown or not. |
true , false
|
true |
no |
Events
Event | rooms-panel.was found in the DOM while bootstrapping. |
|||||||||
---|---|---|---|---|---|---|---|---|---|---|
Type | publish | |||||||||
Description | Is thrown for every rooms panel div the app finds in the DOM while bootstrapping. |
|||||||||
Payload |
The payload object of this event has the following properties:
|
Event | rooms-panel.wants to be cuddled. |
|||||||||
---|---|---|---|---|---|---|---|---|---|---|
Type | publish | |||||||||
Description | Is thrown with global event scope * to inform the integrating environment, that the rooms panel app was load itself (the JavaScript was successfully load) and registered its global listeners. |
|||||||||
Payload |
The payload object of this event has the following properties:
|
Event | rooms-panel.Here are some room offers without pictures. |
|||||||||
---|---|---|---|---|---|---|---|---|---|---|
Type | publish | |||||||||
Description | Is thrown when filterRoomsWithoutImage is set to true and there are only offers without images. |
|||||||||
Payload |
The payload object of this event has the following properties:
|
Event | rooms-panel.render element |
|||||||||
---|---|---|---|---|---|---|---|---|---|---|
Type | subscribe | |||||||||
Description | Will render the given element as an actual rooms panel. |
|||||||||
Payload |
The payload object of this event has the following properties:
|
Event | rooms-panel.hit me baby one more time. |
|||||||||
---|---|---|---|---|---|---|---|---|---|---|
Type | subscribe | |||||||||
Description | Will trigger the bootstrapping again. |
|||||||||
Payload |
The payload object of this event has the following properties:
|