To add a Google Custom Search Engine to your site, you need to create a gadget. Below you will see the code for the CSE I use on this site. Just copy the code, change the highlighted part to the code for your CSE (use V1 code and specify protocol relative), store it somewhere online as an .xml file and put it on your Site (Insert>More Gadgets>add gadget by url and specify the url where you have stored it)
Searches this site and other Google Sites help sites
<?xml version="1.0" encoding="UTF-8" ?> <Module> <ModulePrefs title="Hello World!" /> <Content type="html"> <![CDATA[ <div id="cse-search-form" style="width: 100%;">Loading</div> <script src="//www.google.co.uk/jsapi" type="text/javascript"></script> <script type="text/javascript"> google.load('search', '1', {language : 'en', style : google.loader.themes.MINIMALIST}); google.setOnLoadCallback(function(){ var customSearchControl = new google.search.CustomSearchControl('010428851484230611414:dbm31yqzwea'); customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET); var options = new google.search.DrawOptions(); options.enableSearchboxOnly("http://www.google.co.uk/cse?cx=010428851484230611414:dbm31yqzwea", null, true); customSearchControl.draw('cse-search-form', options); }, true); </script> ]]></Content> </Module> Simple Gadget Creation and hosting
|