 Google Custom Search is one of those tools whose list of Plus points is nearly endless. From providing super relevant search results  to options for On-Demand Indexing. GCS is a boon for all Blog and Website Owners.But the one thing that doesn't fit in place is its exceedingly over simple Search Form ,that again with Google Watermark. In this post I will be telling you how to change the Look of your GC Search Box with a CSS3 search Box.
Google Custom Search is one of those tools whose list of Plus points is nearly endless. From providing super relevant search results  to options for On-Demand Indexing. GCS is a boon for all Blog and Website Owners.But the one thing that doesn't fit in place is its exceedingly over simple Search Form ,that again with Google Watermark. In this post I will be telling you how to change the Look of your GC Search Box with a CSS3 search Box.I am assuming that you have already setup your Google Search Custom search engine if you haven't then check this tutorial. There are many variations GCS but normally the code contains a <script> tag , and it looks something like this:
| 01 | <divid="cse"style="width: 100%;">Loading</div> | 
| 02 | <scriptsrc="http://www.google.com/jsapi"type="text/javascript"></script> | 
| 03 | <scripttype="text/javascript">  | 
| 04 |   google.load('search', '1', {language : 'en', style : google.loader.themes.ESPRESSO}); | 
| 05 |   google.setOnLoadCallback(function() { | 
| 06 |     var customSearchControl = new google.search.CustomSearchControl('XXXXXXXXXXXXXXXXXXXXX:YYYYYYYYYYY'); | 
| 07 |     customSearchControl.setResultSetSize(google.search.Search.SMALL_RESULTSET); | 
| 08 |     customSearchControl.draw('cse'); | 
| 09 |   }, true); | 
| 10 | </script> | 
| 1 | <formid="searchbox_XXXXXXXXXXXXXXXXXXXXX:YYYYYYYYYYY"action="URL of the Page where the Result is to be shown">  | 
| 2 |   <inputvalue="XXXXXXXXXXXXXXXXXXXXX:YYYYYYYYYYY"name="cx"type="hidden"/>  | 
| 3 |   <inputvalue="FORID:11"name="cof"type="hidden"/>  | 
| 4 |   <inputid="q"style="width:150px;"name="q"size="70"type="text"/>  | 
| 5 |   <inputvalue="Search"name="sa"type="submit"/>  | 
| 6 | </form> | 
If you are using the Adsense linked GCS then your search Box should look something like this:
| 01 | <formaction="URL of the page where the Result open id="cse-search-box">  | 
| 02 |   <div>  | 
| 03 |     <inputtype="hidden"name="cx"value="partner-pub-XXXXXXXXXXXXXXXXXXXXX:YYYYYYYYYYY"/>  | 
| 04 |     <inputtype="hidden"name="cof"value="FORID:10"/>  | 
| 05 |     <inputtype="hidden"name="ie"value="ISO-8859-1"/>  | 
| 06 |     <inputtype="text"name="q"size="21"/>  | 
| 07 |     <inputtype="submit"name="sa"value="Search"/>  | 
| 08 |   </div>  | 
| 09 | </form> | 
| 10 | <scripttype="text/javascript"src="http://www.google.com/cse/brand?form=cse-search-box&lang=en"></script>  | 
Courtesy:-Prayag Verma http://www.stylifyyourblog.com/2011/07/customize-google-custom-search-box.html
-By Parthiv Patel
 







 
No comments:
Post a Comment