Skip to main content

Adding search to the site

One of the comments that came out from the user's survey was about searching the 'Tube Map'.


   3.  Perhaps a search box on this page that users could use to quickly locate the item on the map would complement the site.


A partial solution was to add a search, that search the site. this has been achieved using Google Custom Search to the www.sustainablity.net site (see below)




To create the search, you need a Google account and then go to http://www.google.com/cse/


Create a new Custom Search Engine and decide what sites you want to include, the name of the search and whether you want to pay. 


For this project I went for the free/standard edition option which means there will be adverts, as well as the search results from the site. 


When you include the sites to search the format does matter to get it to search the whole you will need to put * at the end, so for example http://www.web-sustainablity.net/* to search all of http://www.web-sustainablity.net/.


When you click next you get taken to a screen that enables you to select the look of the search box and test it out as shown below.




If you happy with it clicking next will take you to a page with JavaScript code you need. This code add to your pages where ever you want the search.



<div id="cse" style="width: 100%;">Loading</div>
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript">
  google.load('search', '1', {language : 'en', style : google.loader.themes.GREENSKY});
  google.setOnLoadCallback(function() {
    var customSearchControl = new google.search.CustomSearchControl('<this bit changes for each customised search>');
    customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
    customSearchControl.draw('cse');
  }, true);
</script>





If you can put up with the adverts, this is a solution to the problem of allowing the user to search the site whilst being free.




This work has been supported by funding from JISC. The site can be viewed at https://sites.google.com/site/emknorg/ or http://www.web-sustainablity.net/emkn/ Survey about this material can be found at: http://www.eSurveysPro.com/Survey.aspx?id=67775a0a-336f-45a5-a222-2f1a6615752c please feel free to fill it in or http://www.eSurveysPro.com/Survey.aspx?id=cec22f0a-e467-4c15-a319-74d96bb8ed9d

Comments

Popular posts from this blog

Free Web Hosting on Google Drive: Case study

Previously I looked at using other tools    to host sites sustainably (or even free)  such as:  Dropbox  (see: http://websitesustainability.blogspot.co.uk/2011/03/alternative-hosting-approach-1-dropbox.html )  Google Sites (see: http://websitesustainability.blogspot.co.uk/2011/03/google-sites-for-sustainability-week-3.html  ) Hosting options: http://websitesustainability.blogspot.co.uk/2012/08/hosting-how-to-get-it-out-there-for.html Free tools: http://websitesustainability.blogspot.co.uk/2012/08/the-best-free-tools-for-website.html Amazon S3 (see: http://websitesustainability.blogspot.co.uk/2011/10/thoughts-about-using-amazon-s3.html ) In this post I look at a real web site being moved to being hosted on google Drive as a case study of moving sites that need preserving on to Google Drive as a hosting option. 1. First step is to capture the static HTML files. We need to copy all the files we want, this has been discussed previous see ...

The best free tools for website sustainability.

By Ahsan Anderson, (anderson.ahsan@gmail.com)  Nuffield Bursary Student . All views are Ahsan Anderson not necessarily the views of the blog editor. I’ve created a few websites in the past, varying from those for business use or those to advertise bands in local areas, but with my line of work they’ve all had the same thing in common, and that’s money. When I’ve created them I have used a variety of tools; web builders for example, and one very key thing to these is that they all cost money for hosting. There are a few hurdles you can’t overcome, for example, there is no escaping the cost you will have to pay to have your domain name bought, but when building your website, sometimes there is no need to have to pay for the tools, as I will explain now. Whether you are willing to pay for the hosting or you wish to host yourself (or use free sites like 000hosting.com) this list will narrow down the choice of good modern builders that you can use. I was looking for...