Changes

Jump to navigation Jump to search

Embedded Iframe

190 bytes added, 11:49, 1 July 2021
no edit summary
[[Category:Widgets]]
[[Category:Troubleshooting]]
<div class="heading">Iframe iFrame Generator</div> This page is about the menu {{#fas:cog}} (SETTINGS) BOOKING ENGINE > BOOKING WIDGETS > IFRAME iFrame GENERATOR and explains how to embed the booking page into a web site.
<span style="color: #f3e504; font-size: 150%;" >{{#fas:lightbulb}} </span> 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.
 =Generate Code SnippetUsing an iFrame=Set Ising 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. If you want to use an iFrame set the your parameters in the Iframe iFrame Generator then click on "Get Code". Paste this code into the source code of your website.
<span style="color: #f3e504; font-size: 250%;" >{{#fas:lightbulb}} </span> Do not change the default settings for "Opening Checkin Date", "Length of Stay" and "Number of Guests" if you want to redirect from a widget to an embedded booking page.
'''Step 1: Customize the widget'''
Go to {{#fas:cog}} (SETTINGS) BOOKING ENGINE > BOOKING WIDGETS
*Set the value of the “formAction” parameter to be the full URL of the page containing the iFrame. This will cause the booking widget to take the visitor directly to the page with the iFrame and will add the data from the booking widget to the URL as additional parameters
*Customize the widget according to your requirements
'''Step 3: Customize the iFrame'''
Go to {#fas:cog}} (SETTINGS) BOOKING ENGINE > BOOKING WIDGETS > EMBEDDED IFRAME iFrame and set
*"Opening Checkin Date" = Default
*"Length of Stay " = Default
*Copy the code
*Change the element '''src''' to be called '''data-src'''
*Add the new elements ''' ouriframeouriFrame''' and "src=””" as follows so the iFrame starts like '''<iframe ourIframe iFrame ouriFrame src="" the new data-src element should follow src=”” after a space.
Example:
<span style="background-color: #f8f9fa; border: 1px solid #eaecf0;border-radius: 2px; padding: 1px 4px;"><nowiki><iframe ourIframe iFrame ouriFrame src=”” data-src="https://beds24.com/booking2.php?propid=12345&amp;referer=iframeiFrame" width="800" height="2000" style="max-width:100%;border:none;overflow:auto;"><p><a href="https://beds24.com/booking2.php?propid=12345&amp;referer=iframeiFrame" title="Book Now">Book Now</a></p></iframeiFrame></nowiki></span>
'''Step 4: Install the iFrame 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 </iframeiFrame>
<div style="background-color: #f8f9fa !important; border: 1px solid #eaecf0;border-radius: 2px; padding: 1px 4px;">
<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 iFrameAttrIdentifier = "ourIframeouriFrame";
const currentUrl = new URL(window.location.href);
let parametersString = "";
}
});
const iframes iFrames = document.getElementsByTagName("iframeiFrame"); for (let iframe iFrame of iframesiFrames) { if (iframeiFrame.getAttribute(iframeAttrIdentifieriFrameAttrIdentifier) !== null) { let iframeSrc iFrameSrc = iframeiFrame.getAttribute("data-src"); if (!iframeSrciFrameSrc.includes("?")) { iframeSrc iFrameSrc += "?";
}
iframeSrc iFrameSrc += parametersString; iframeiFrame.setAttribute("src", iframeSrciFrameSrc)
}
}
}
addUrlParamsToIframeSrcsaddUrlParamsToiFrameSrcs();
</nowiki>
</script>
=Multiple Properties=
Set "Properties" = All to create a booking an Iframe iFrame Code for a multiple property booking page. The multiple property booking page.
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.
==Scrollbar ==
There are two possible reasons for a scrollbar to appear:
1. The Iframe iFrame has not enough height for the content. Raise the value in the <code>height</code> parameter in the booking. For example in this link the height is 1500 (height="1500"):
<code><nowiki><iframe iFrame style="max-width: 100%; border: none; overflow: auto;" src="https://www.beds24.com/booking2.php?propid=3103&amp;numdisplayed=5&amp;numnight=1&amp;numadult=2-1&amp;referer=iframeiFrame/" height="1500" width="800"></iframeiFrame></nowiki></code>
2. The container on your website which holds the Iframe iFrame does not have enough height.
==Dates and/or numbers of guests do not transport from widget ==
This happens when you specify the dates and/or number of guests in the URL. Remove the <code>numadult</code> and <code>advancedays</code> parameters from the URL of the IframeiFrame.
Also make sure that the widget has the same options guest selection as the booking page.
<span style="color:#fe746c;“ >{{#fas:exclamation-triangle}} </span> If you allow guests to book multiple rooms on your booking page the number of guests will never transport from the widget.
==Scroll Iframe iFrame to the top ==When a long page inside an Iframe iFrame changes to a shorter page, the guest viewing the page might be left at the bottom looking at what appears to be a blank page.Possibilities to access and control the Iframe iFrame from outside (your website) are limited.
Try adding onload="window.parent.parent.scrollTo(0,0)" to the IframeiFrame. For example:
<code><nowiki><iframe iFrame onload="window.parent.parent.scrollTo(0,0)" style="max-width: 100%; border: none; overflow: auto;" src="https://www.beds24.com/booking2.php?propid=3103&amp;numdisplayed=5&amp;numnight=1&amp;numadult=2-1&amp;referer=iframeiFrame/" height="1500" width="800"></iframeiFrame></nowiki></code>
*Reduce the height of the embedded booking page or the IframeiFrame. Keeping the Iframe iFrame small and allowing scroll bars to navigate inside it can work well.
==Page is insecure==
==Bottom of the page is blank==
When a long page inside an Iframe 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_pageScroll_iFrame_to_the_top_of_the_page|Read this help document]] to learn about solutions for this problem.
==Display problems on mobile==
If content is cut off you most likely have not enough width or height in the holding container. Increase either the width and height or try using a smaller font size.
Iframes iFrames on mobile devices are problematic. Make sure you have following code in the <head>: <meta name="viewport" content="width=device-width, initial-scale=1">. If you use the booking page in an Iframe iFrame we recommend you set up a special mobile page for the page where you have embedded the Iframe iFrame which opens the booking page in a new page instead of an IframeiFrame.
==Google Map not showing==

Navigation menu