Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #265634

    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]&#8221; + (!!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://&#8221; + 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>

    #265695

    Hi Sam!

    Try putting the code in a Text Widget.

    Cheers!
    Josue

    #266050

    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.

    #266052

    #266057

    Thanks Josue, I can understand that…. steep learning curve :)

    #266059

    You’d need to replace all the iterations of http by https in the widget code.

    Cheers!
    Josue

    #266066

    Thanks, I realize not an Enfold issue.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Unsure how to add 3rd party widget to my Enfold site’ is closed to new replies.