Hi,
I wish to add a flight search widget to my Enfold site.
1) Is this possible?
2) Where should I put the widget code? see below.
<div id=”mmd-flight-widget”></div>
<script type=”text/javascript”>(function initWidget() {
var options = {
layout: {
theme: “momondo”
, width: “300”
, height: “250”
},
airports: {
origin: “LHR”,
destination: “GOI”
},
settings: {
openNewWindow: true,
domain: “www.momondo.co.uk”,
source: “”
}
};
var settings = options.settings;
var airports = options.airports;
var layout = options.layout;
var encoding = null;
onWidgetLoad = function (f)
{
f(“mmd-flight-widget”, {
searchForms: [{
type: 1,
searchURL: “http://[DOMAIN][PATH][QUERY]” + (!!settings.source ? “&source=” + settings.source : “”),
openNewWindow: settings.openNewWindow,
currency: settings.currency,
segments: [
{
airports: [
{ code: airports.origin || “” },
{ code: airports.destination || “” }
]
},
{
airports: [
{ code: airports.destination || “” },
{ code: airports.origin || “” }
]
}
]
}]
});
};
var scr = document.createElement(“script”);
scr[“src”] = “http://” + settings.domain + “/widgets/searchform?dimensions=” + layout.width + “x” + layout.height + “&types=1&callback=onWidgetLoad&theme=” + layout.theme;
var tag = document.getElementsByTagName(“head”);
if (tag && tag.length)
{
tag = tag[0];
tag.appendChild(scr);
}
})();
</script>
Hi Sam!
Try putting the code in a Text Widget.
Cheers!
Josue
I’ve tried that Josue. The Widget shows title “Our Recommended Search Engine” but no flight search box.
https://motorbiketoursindia.co.uk/motorcycle-holidays/
Any ideas thanks.
Thanks Josue, I can understand that…. steep learning curve :)
You’d need to replace all the iterations of http by https in the widget code.
Cheers!
Josue
Thanks, I realize not an Enfold issue.