• Is there a way to open the quick search results in a frame instead of opening a new window? The site in question is bradsellsmore.com I’d like for the quick search results to display the same way the other MLS items appear. This would allow me to keep all the header and footer information that displays on the site, and just show the results in an iframe.

    Thanks,

    Brent

Viewing 5 replies - 1 through 5 (of 5 total)
  • I created a small script that will do this. If you still want to know how, reply back and I’ll hook you up!

    Thread Starter brentpreddy

    (@brentpreddy)

    You betcha! I’m still using the widget just letting it open in a new window. I’d all but given up!

    Thanks!

    Brent

    Ok cool, Ill post the code for you in just a bit, then others can use it too. One issue that still needs resolved is IE. Since iframes are involved, IE tells it to open in a new window still but with the results produced in your site. I’m working on that fix still, but it works perfect in Firefox.
    Once I create the JS fix fir it, I’ll repost it again.

    1.)
    Open FlexIDXHS.php in your plugins folder
    Then go to line# 641 and REPLACE WITH THIS:

    <script type="text/javascript">
    /* <![CDATA[ */
    var quick_search_base_url = 'http://YOUR URL GOES HERE/results?{$flexidxhs_opt['idx-url']}';
    function searchnow(form_id) {

    2.)
    Create a draft page called results and make sure the slug is the same.

    3.)
    Open your page.php in your template and add this above your content area. If you’re template is using index.php, you would do the same.

    <?php if ( is_page( 'results' )) {
    function selfURL() { $s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : ""; $protocol = strleft(strtolower($_SERVER["SERVER_PROTOCOL"]), "/").$s; $port = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":".$_SERVER["SERVER_PORT"]); return $protocol."://".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI']; } function strleft($s1, $s2) { return substr($s1, 0, strpos($s1, $s2)); }
    echo '<iframe src="';  echo substr(selfURL(), 53);  echo '" width="100%" height="800px" style=" margin-top: 0; margin-left: -1px;"></iframe>';
    } ;?>

    That’s it, you should now have a dedicated page for all results to show within your sites template.

    Fix for new window issue: open FlexIDXHS.php

    Locate this:

    function _js_search(){
        $js_string = "popupWin = window.open(search_link, 'open_window');";
        $js_string = apply_filters('flexidx_js_search', $js_string);
        return $js_string;
    }
    
    function _js_advsearch(){
        $js_string = "popupWin = window.open(quick_search_base_url, 'open_window');";
        $js_string = apply_filters('flexidx_js_advsearch', $js_string);
        return $js_string;
    }

    Replace it with this:

    function _js_search(){
        $js_string = "popupWin = window.open(search_link, '_self');";
        $js_string = apply_filters('flexidx_js_search', $js_string);
        return $js_string;
    }
    
    function _js_advsearch(){
        $js_string = "popupWin = window.open(quick_search_base_url, '_self');";
        $js_string = apply_filters('flexidx_js_advsearch', $js_string);
        return $js_string;
    }

    All you have to do is replace ‘open_window’ with ‘_self’ and results will open in parent window. Be sure to add everything I described above to accomplish task.

    Hope this helps!!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: FlexIDX Home Search] Quick Search Widget Results in Frame?’ is closed to new replies.