A complete example
A whole small site, in plain HTML: the home page has the site’s own search form, a price line that follows it and room cards with live prices, the booking page carries the booking window, the account page carries the guest area, and one block of CSS variables gives every component the site’s look. Copy it, put the hotel’s number in, and it works on any address that is on the hotel’s allowed origins.
Every attribute here is explained on the page it comes from: Search form, Book button, Offer prices, Prices and availability, Styling.
- index.html the home page: search form, a price for the guest’s dates, room cards
- booking.html the booking window
- account.html the guest area
- site.css the site’s own styles and the
--pms-*variables
<!doctype html><html lang="en"><head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Hotel Example</title> <link rel="stylesheet" href="/site.css"> <script src="https://link.tape-chart.com/widget/v1.js" data-property="YOUR_PROPERTY_NUMBER" data-booking-path="/booking.html" data-account-path="/account.html" defer></script></head><body> <header class="site-header"> <a href="/">Hotel Example</a> <nav> <a href="/account.html">My bookings</a> <a class="book-now" href="/booking.html" data-pms-book data-stay="weekend">Book this weekend</a> </nav> </header>
<!-- the site's own form; our calendar and guests panel open from its buttons --> <form class="stay-search" method="get" action="/booking.html"> <button type="button" class="stay-field" data-pms-dates> <small>Check-in</small> <span data-pms-text="checkIn">Add date</span> </button> <button type="button" class="stay-field" data-pms-dates="check-out"> <small>Check-out</small> <span data-pms-text="checkOut">Add date</span> </button> <button type="button" class="stay-field" data-pms-guests> <small>Guests</small> <span data-pms-text="guests">2 adults</span> </button> <button class="stay-go">Search</button> </form>
<!-- these two lines follow the form above: each appears only on a definite answer for the guest's dates --> <p class="rate" data-pms-if="available" data-stay="search" hidden> Rooms for your dates from <span data-pms-text="fromPricePerNight">our best rate</span> a night </p> <p class="rate" data-pms-if="!available" data-stay="search" hidden> Nothing is free for these dates. </p>
<!-- one card per room type, with live prices for the coming weekend --> <div class="rooms"> <template data-pms-each="rooms" data-stay="weekend"> <article class="room"> <img src="{{photo}}" alt="{{name}}" loading="lazy"> <span class="room-badge" data-pms-if="scarce">Only {{left}} left</span> <h3>{{name}}</h3> <p>Sleeps {{maxGuests}}<span data-pms-if="area"> · {{area}} m²</span></p> <p data-pms-if="available">from <strong>{{pricePerNight}}</strong> a night</p> <p data-pms-if="!available">Not on these dates</p> <a class="book-now" href="{{bookUrl}}">Book {{name}}</a> </article> </template> <!-- your own fallback for a visitor without scripts; a repeat draws nothing when prices cannot be read --> <noscript><p>See our rooms and prices on the <a href="/booking.html">booking page</a>.</p></noscript> </div></body></html><!doctype html><html lang="en"><head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Book — Hotel Example</title> <link rel="stylesheet" href="/site.css"> <script src="https://link.tape-chart.com/widget/v1.js" data-property="YOUR_PROPERTY_NUMBER" data-booking-path="/booking.html" data-account-path="/account.html" defer></script></head><body> <header class="site-header"> <a href="/">Hotel Example</a> <nav><a href="/account.html">My bookings</a></nav> </header>
<main> <!-- the whole booking flow; it reads check_in, check_out, adults and child_ages from this page's address --> <div data-pms-booking="window"></div> </main></body></html><!doctype html><html lang="en"><head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>My bookings — Hotel Example</title> <link rel="stylesheet" href="/site.css"> <script src="https://link.tape-chart.com/widget/v1.js" data-property="YOUR_PROPERTY_NUMBER" data-booking-path="/booking.html" data-account-path="/account.html" defer></script></head><body> <header class="site-header"> <a href="/">Hotel Example</a> </header>
<main> <!-- sign-in by an emailed link, the guest's bookings and profile --> <div data-pms-booking="portal"></div> </main></body></html>/* 1. the look of every booking component — on :root, never on our <div> */:root { --pms-primary: #1d3b36; --pms-primary-foreground: #ffffff; --pms-background: #faf7f0; --pms-border: #d9cfb8; --pms-input: #c9b88a; --pms-radius: 4px; --pms-font: "Inter", Arial, sans-serif; --pms-heading-font: "Lora", Georgia, serif;}
/* 2. the site's own form */.stay-search { display: flex; gap: 1px; border: 1px solid #d9cfb8; background: #d9cfb8;}.stay-field { flex: 1; padding: 14px 18px; border: 0; background: #fff; font: inherit; text-align: left; cursor: pointer;}.stay-field small { display: block; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #6b6f6a;}.stay-go { padding: 0 28px; border: 0; background: #1d3b36; color: #fff; font: inherit; cursor: pointer;}/* Search wakes up once both dates are in */.stay-search:not([data-pms-has-dates]) .stay-go { background: #8fa5a9;}/* a value still in your own words is quieter than a live one */[data-pms-text]:not([data-pms-filled]) { color: #9b9484;}/* a line the script hides stays hidden, whatever display another rule gives it */[hidden] { display: none !important;}
/* 3. the room cards */.rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px;}/* room for the cards is kept until the script has looked at the page: nothing jumps */html:not([data-pms-ready]) .rooms { min-height: 420px;}.room { border: 1px solid #d8cdb6; background: #fffdf8;}.room img { width: 100%; height: 190px; object-fit: cover;}.room[data-pms-available="false"] { opacity: 0.6;}
.book-now { display: inline-block; padding: 12px 24px; background: #1d3b36; color: #fff; text-decoration: none;}
@media (max-width: 640px) { .stay-search { flex-direction: column; } .stay-go { padding: 14px; }}What follows the search form
The two price lines under the form carry data-stay="search": they are asked once the guest has picked both dates, and each appears only on a definite answer. The price inside the first line has no stay of its own, so it takes the line’s. The room cards do not follow the form: they are priced for the coming weekend, so the page shows rooms before any date is picked. To make the cards follow the form too, write data-stay="search" on the rooms template — no card is drawn then until the search is complete. See A price that follows the search form.
What to change first
YOUR_PROPERTY_NUMBER— the hotel’s nine digits, in all three files.- The paths. The example’s pages are
/booking.htmland/account.html, so the script tag names them. If yours are/bookingand/account, leave both attributes out. - The variables at the top of
site.css— your site’s own colours, corners and fonts. See Styling for the whole list and five recipes.
What the hotel does
- Adds the site’s address to the allowed origins (Tape Chart Link → Booking engine → Firewall).
- Sets the account page’s address (Booking engine → Configuration) so that sign-in links in its emails open on the site.