Saturday, April 4, 2009

Blogspot searching

One of the annoying things about blogspot (blogger, Google blogs) is the default blogspot ad at the top of the page. It has buttons like “next blog” that add no value to my blog.

However, by deleting this element (from the HTML template in blogger setup), I lost the default “search blog” functionality. I want to search for old postings that are not tagged (e.g. for “Web” and “business” and “model”) and some of my readers have asked for this too.

The HTML is easy enough. To search this blog for “monetize” it’s similar to a standard Google URL — the base URL plus the search terms:

http://openitstrategies.blogspot.com/search?q=Web+business+model
But how do we enter the search string, without any server changes? Presumably there’s some sort of HTML form required.

A quick Google search found a posting on BlogoSquare, which doesn’t quite solve the problem. However, the blog itself has exactly the sort of search HTML I was seeking.

Now you can see my new search HTML on the right. Here is the HTML
<form id="searchform"
   action="http://openitstrategies.blogspot.com/search"
   method="get">
<div>
  <input id="q" value="" name="q"
     type="text"/>
  <input id="searchsubmit" value="Search"
     type="submit"/>
</div>
</form>
This turns out to be easier than I thought. I plan to promulgate it to my other blogs in the future.

No comments: