AnsweredAssumed Answered

Using Google Custom Search/site search in an HTML module (widget)

Question asked by jb31639 on Feb 25, 2016
Latest reply on Feb 26, 2016 by jb31639

Hi

Has anyone created a google custom search widget using the HTML Module in Blackboard. It almost works! I can't get autocomplete to work. Note this isn't searching Blackboard but is used to find stuff on other subdomains on our site.

 

I'm using the HTML modules (Module Type = HTML) and adding something like (see below - experimenting with min-height).

 

I think maybe blackboard is blocking autocomplete (javascript??) or something. Autocomplete does work if you preview the module/widget.

 

I'm using version 1 of the custom search tool as I couldn't get version 2 to work

 

Any suggestions?

 

Thanks

Jason

 

Sample code......

 

<div>

<strong>I need help with:</strong>

</div>

 

 

 

<div >

 

 

        <div id='cse' style='width: 100%;'>Loading</div>

        <script src='//www.google.com/jsapi' type='text/javascript'></script>

        <script type='text/javascript'>

        google.load('search', '1', {language: 'en', style: google.loader.themes.V2_DEFAULT});

        google.setOnLoadCallback(function() {

          var customSearchOptions = {};

          var customSearchControl =   new google.search.CustomSearchControl('0000000:123456removed', customSearchOptions);

          customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);

          var options = new google.search.DrawOptions();

          options.setAutoComplete(true);

          customSearchControl.draw('cse', options);

        }, true);

        </script>

 

 

 

</div>

 

<div>

 

<p>blah blah blah info text </p>

</div>

Outcomes