Changes

Jump to navigation Jump to search

Embedded Iframe

65 bytes removed, 08:10, 27 November 2023
=Using an iFrame=
Ising Using iFrames are convenient but may have a sub optimal usability experience.
Consider opening the booking page in a new tab instead of embedding it in an iFrame.
Consider opening the booking page in a new tab instead of embedding it in an iFrame.
If you do want to use an iFrame you can use following method to overcome the issue:  If you do want to use an iFrame you can use following method to overcome the issue. This solution passes the widget data directly to the page holding the iFrame and relies on a special script installed on the page to pass the parameters to the iFrame. The iFrame then loads the booking page with the data from the widget.
This avoids the use of cookies to pass the data and should not be blocked by security or privacy settings.
<span style="color:#fe746c;“ >{{#fas:exclamation-triangle}} </span>The solution requires that your website can have additional parameters added to your page URL without affecting their ability to load.
<span style="color:#019cde; font-size: 150%;“ >{{#fas:info-circle}} </span> The principle here is to open your URL containing the iFrame directly with the booking page parameters added to your URL after a ?. The supplied script installed on your page will pass these URL parameters through to the iFrame which will apply them to the booking page within the iFrame.
'''Step 1: Customize the widget'''
Example:
 
<span style="background-color: #f8f9fa; border: 1px solid #eaecf0;border-radius: 2px; padding: 1px 4px;"><nowiki><iFrame data-src="https://beds24.com/booking2.php?propid=12345&amp;referer=iFrame" width="800" height="2000" style="max-width:100%;border:none;overflow:auto;"><p><a href="https://beds24.com/booking2.php?propid=12345&amp;referer=iFrame" title="Book Now">Book Now</a></p></iFrame></nowiki></span>
'''Step 5: Install the iFrame and script on your website'''
*Add the following script directly after the iFrame end tag </iFrame>
Example iframe:
<div style="background-color: #f8f9fa !important; border: 1px solid #eaecf0;border-radius: 2px; padding: 1px 4px;">
<span style="background-color: #f8f9fa; border: 1px solid #eaecf0;border-radius: 2px; padding: 1px 4px;"><nowiki><iFrame data-src="https://beds24.com/booking2.php?propid=12345&amp;referer=iFrame" width="800" height="2000" style="max-width:100%;border:none;overflow:auto;"><p><a href="https://beds24.com/booking2.php?propid=12345&amp;referer=iFrame" title="Book Now">Book Now</a></p></iFrame></nowiki></span></div>
 
 
Script:
<div style="background-color: #f8f9fa !important; border: 1px solid #eaecf0;border-radius: 2px; padding: 1px 4px;">
<span style="background-color: #f8f9fa; border: 1px solid #eaecf0;border-radius: 2px; padding: 1px 4px;"><nowiki>
<script>
<nowiki>
var addUrlParamsToIframeSrcs = function() { const validParameters = ["checkin", "checkout", "numnight", "numadult", "numchild", "ownerid", "propid", "roomid", "referer", "redirect", "lang", "group", "nogroup", "category1", "category2", "category3", "category4", "customParameter"]; const currentUrl = new URL(window.location.href); let parametersString = ""; validParameters.forEach(parameter => { const parameterValue = currentUrl.searchParams.get(parameter); if (parameterValue !== null) { parametersString += "&" + parameter + "=" + parameterValue; } }); const iframes = document.getElementsByTagName("iframe"); for (let iframe of iframes) { let iframeSrc = iframe.getAttribute("data-src"); if (iframeSrc === null) { continue; } if (!iframeSrc.includes("?")) { iframeSrc += "?"; } iframeSrc += parametersString; iframe.setAttribute("src", iframeSrc) } }; addUrlParamsToIframeSrcs();
</nowiki>
</script>
</nowiki></span>
</div>
When a guest clicks on "Book" for one of the listed properties they will be taken to the property booking page where they can book.
If you you have embedded property booking pages as well and want to redirect the guest to this page go to {{#fas:cog}} (SETTINGS) BOOKING ENGINE > BOOKING PAGE > BEHAVIOUR and set "Booking Redirect" = "Multiple Property Only" and enter the URL of the property booking page followed by the redirect destination in "Booking Redirect Url" like this:
<code><nowiki> https://beds24.com/booking.php?propid=12341&redirect=https://www.mywebsite/propertyA</nowiki></code>
==Page is insecure==
Most likely you have a link to an image with is not securely hosted.
 
==Bottom of the page is blank==
When a long page inside an iFrame changes to a shorter page, the guest viewing the page might be left at the bottom looking at what appears to be a <b>blank page</b>. [[Scroll_iFrame_to_the_top_of_the_page|Read this help document]] to learn about solutions for this problem.
==Display problems on mobile==

Navigation menu