Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Google Custom Search issues

  • This topic is empty.
Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #150043
    Kevin Mamaqi
    Participant

    Hello,

    I’m developing a website right now and I’m using Google Custom Search and the new Bootstrap reset and grid system.

    The problem here is with that the image of the GCS button, here you got an image and here is the codepen link isn’t displaying properly.

    I’m stuck (and more after I use codepen), so any help would be appreciated.

    Thanks.

    #150044
    georgearnall
    Participant

    Did you want the image that big ? Basically, the image is too small to be stretched that large. You could just bump up the padding. Demo

    Also your mockup doesn’t seem to have an icon ?

    #150047
    Kevin Mamaqi
    Participant

    Hello georgearnall,

    My image isn’t a mockup is a pic of my website in localhost and no, I don’t wan’t the image so big, I just copied the code that I can see with firebug.

    The code is loaded by google, so I only can override it.

    Viewing your code I changed this and it works:

    height: auto;
    min-width: auto;

    Of course in my case adding !important after to override it.
    Here is the link.

    Thank you.

    PD: I still can’t understand why this happens.

    #150051
    georgearnall
    Participant

    Just set up a CSE to test this and its working alright. It must be something you have changed in your settings so it might be worth taking a look.

    The original styling for the image looks like this:
    width: 13px;
    height: 13px;
    padding: 6px 27px;
    min-width: 13px;
    margin-top: 2px;

    (For some reason the block code format is not working)

    #150838
    Kevin Mamaqi
    Participant

    Hello again and sorry for the long time with no response.

    I still have problems with Google CSE. I created a new one because I didn’t find the reason of the trouble and now everything is getting worst.

    The site is now online (URL) and nothing appears, I really don’t know why.

    The Google CSE is at the right of the menu.

    Any ideas?

    Thanks.

    #150840
    Paulie_D
    Member

    It appears to be commented out in your HTML.

    #150850
    Kevin Mamaqi
    Participant

    Hi Paulie_D,

    You are right, but this was the old searchform, I commented it. Now is only the new one and nothing appears.

    #150853
    Paulie_D
    Member

    So where is the code for the new one in your HTML?

    There’s this

    <gcse:searchbox></gcse:searchbox>
    

    Not sure what the heck that is.

    However, my guess is that you are missing a script or something.

    #150857
    Kevin Mamaqi
    Participant

    Is in the menu, at the right, but doesn’t display nothing and I don’t know why:

    <div class="col-md-4 busqueda">
                         <script>
      (function() {
        var cx = 'partner-pub-CCCXXXCCCXXXCCCXXXCCC';
        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></gcse:searchbox> 
                    </div>
    
    #150859
    Paulie_D
    Member

    Is that the ONLY script that is required?

    On looking at the previous examples in this thread it look like 2 were needed.

    Like this?

    <script type="text/javascript" async="" src="http://www.google.com/cse/cse.js?cx=005461060208947989604:keuvkbpdcxu"></script>
    
    #150861
    Kevin Mamaqi
    Participant

    Yes, because the script that are you mentioning in the last comment is loading in the head of my site.

    But I’m not very sure why.

    #150870
    Paulie_D
    Member

    I can only suggest you review the documentation on the mark-up need to create the search box etc.

    This http://georgearnall.com/tests/ on inspection seems quite different from you have.

    #150886
    Kevin Mamaqi
    Participant

    I don’t know what is going wrong.

    I had changed my Google CSE configuration and now is working.

    I was using Two Columns option (in the design) and now I’m using Two Pages option, now it works.

Viewing 13 posts - 1 through 13 (of 13 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.