Jump to content

Where to insert Google Custom Search code?


Recommended Posts

I'm using V. 1.3.1. I'd like to keep the Search box on the top of the store but have it show Google custom search results. I've got a paid GSE. I've tried replacing the code in the blocksearch module but it resulted in a blank page. If this is a too complex thing to do, I'm willing to pay.

Thanks.

Link to comment
Share on other sites

paste the code here and i check

 

This is how the code looks

<div id="cse" style="width: 100%;">Loading</div>
<script src="https://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript">
 google.load('search', '1', {language : 'en', style : google.loader.themes.ESPRESSO});
 google.setOnLoadCallback(function() {
var customSearchOptions = {};  var customSearchControl = new google.search.CustomSearchControl(
  '0154404366549420953:ii3qimmcldk', customSearchOptions);
customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
customSearchControl.draw('cse');
 }, true);
</script>

Link to comment
Share on other sites

you need to add this

 

 

 

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

<script src="https://www.google.com/jsapi" type="text/javascript"></script>

{literal}

<script type="text/javascript">

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

google.setOnLoadCallback(function() {

var customSearchOptions = {}; var customSearchControl = new google.search.CustomSearchControl(

'0154404366549420953:ii3qimmcldk', customSearchOptions);

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

customSearchControl.draw('cse');

}, true);

</script>{/literal}

Link to comment
Share on other sites

Where do I need to paste that code?

Thank you!

 

you need to add this

 

 

 

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

<script src="https://www.google.com/jsapi" type="text/javascript"></script>

{literal}

<script type="text/javascript">

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

google.setOnLoadCallback(function() {

var customSearchOptions = {}; var customSearchControl = new google.search.CustomSearchControl(

'0154404366549420953:ii3qimmcldk', customSearchOptions);

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

customSearchControl.draw('cse');

}, true);

</script>{/literal}

Link to comment
Share on other sites

I have tried adding the code to existing code and replacing the existing code in blocksearch.tpl and it didn't make any change. :(

 

you need to add this

 

 

 

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

<script src="https://www.google.com/jsapi" type="text/javascript"></script>

{literal}

<script type="text/javascript">

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

google.setOnLoadCallback(function() {

var customSearchOptions = {}; var customSearchControl = new google.search.CustomSearchControl(

'0154404366549420953:ii3qimmcldk', customSearchOptions);

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

customSearchControl.draw('cse');

}, true);

</script>{/literal}

Link to comment
Share on other sites

  • 4 years later...
×
×
  • Create New...