Changes

Jump to navigation Jump to search

Embedded Iframe

266 bytes removed, 18:44, 19 August 2022
no edit summary
<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'''
'''Step 3: Customize the iFrame'''
Go to {{#fas:cog}} (SETTINGS) BOOKING ENGINE > BOOKING WIDGETS > EMBEDDED iFrame and set
*"Opening Checkin Date" = Default
*"Length of Stay " = Default
*Click on "Get Code"
*Copy the code
*Change the element '''src''' to be called '''data-src'''*Add and leave the URL the new elements ''' ouriFrame''' and "src=””" as follows so same. There should be no scr in the iFrame starts like '''<iFrame ouriFrame src="" , the new data-src element should follow src=”” after a spacescript will add it.
Example:
<span style="background-color: #f8f9fa; border: 1px solid #eaecf0;border-radius: 2px; padding: 1px 4px;"><nowiki><iFrame ouriFrame src=”” 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 45: Install the iFrame and script on your website'''
*Paste the modified code snipped into the HTML of your website where you want show the iFrame
*Add the following script directly after the iFrame end tag </iFrame>
 
Example:
<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>
 
 
<script>
<nowiki>
var addUrlParamsToiFrameSrcs addUrlParamsToIframeSrcs = function () { const validParameters = ["checkin","checkout","numnight","numadult","numchild","ownerid","propid","roomid","referer","redirect","lang","group","nogroup","category1","category2","category3","category4", "customParameter"]; const iFrameAttrIdentifier = "ouriFrame"; 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 iframes = document.getElementsByTagName("iFrameiframe"); for (let iFrame iframe of iFramesiframes) { if (iFrame.getAttribute(iFrameAttrIdentifier) !== null) { let iFrameSrc iframeSrc = iFrameiframe.getAttribute("data-src"); if (iframeSrc === null) { continue; } if (!iFrameSrciframeSrc.includes("?")) { iFrameSrc iframeSrc += "?"; } iFrameSrc iframeSrc += parametersString; iFrameiframe.setAttribute("src", iFrameSrciframeSrc) } }}addUrlParamsToiFrameSrcs; addUrlParamsToIframeSrcs();
</nowiki>
</script>
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