Google custom search results in popup on page

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

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 also didn't solve the problem. Is there a way to disable this Google Custom Search from opening results in pop-ups?

+3


source to share


3 answers


Go to Google Custom Search Control Panel . Select the search engine in which you generated the key and code. Go to see and feel from the sidebar. Change the layout from "Overlay" (popup) to the style you want.



+5


source


You can follow the image to do this -

Click Look and Feel on the left, then select the layout you want. After that click Save and get the code



enter image description here

+1


source


Try changing your linktarget from _self to _parent.

<gcse:searchbox-only linktarget="_parent"

      

0


source







All Articles