Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Custom Search results opening in popup on page

I'm not sure what I'm doing wrong but the Google Custom Search I'm setting up on this site I have is not working the way I need it to. What I want is for the results to display within a page, and while the search takes me to the page, the results appear in a popup window for some reason.

This is what I have:

    <script>
        (function () {
            var cx = '[hidden]';
            var gcse = document.createElement('script');
            gcse.type = 'text/javascript';
            gcse.async = true;
            gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
                '//www.google.com/cse/cse.js?cx=' + cx;
            var s = document.getElementsByTagName('script')[0];
            s.parentNode.insertBefore(gcse, s);
        })();
    </script>

<gcse:searchbox-only linktarget="_self" resultsUrl="/HomePage/Search-Results"></gcse:searchbox-only>

I tried using _parent for linktarget, but that did not solve the issue, either. Is there a way to disable this Google Custom Search from opening results in pop-ups?

like image 862
Dejsa Cocan Avatar asked Feb 10 '23 10:02

Dejsa Cocan


1 Answers

Go to Google Custom Search Control panel. Select the Search-engine where you generated the Key & Code. Go to Look and Feel, from the sidebar. Change the Layout from 'Overlay'(Popup) to the desire style you need.

like image 56
Aravindhan Jayakumar Avatar answered Feb 12 '23 23:02

Aravindhan Jayakumar