Wednesday, January 14, 2009

Add search box to new blogger

Add search box to new blogger

Blogger have a build in search box in the top navigation bar, but that search box searches all blog on blogger. You can include a similar search box on your blog template, to give your readers a chance to search your blog. The advantage by adding this search box is that the result is showed in the main body of your Blog unlike the search box in the top navigation bar.
How to add the search box

The easiest way to add the search box is under Template chooses where you would like the search box to be placed and click "Add a Page Element". Select "HTML/JavaScript".

Add the following code, but before you add it you have to change some parts of it to make it work:


<p align="left">
<form id="searchthis" action="BLOG-URL/search" style="display:inline;" method="get">
<strong>SEARCH HERE<br/></strong>
<input id="b-query" maxlength="255" name="q" size="20" type="text"/>
<input id="b-searchbtn" value="Search" type="submit"/>
</form></p>


It is importen that you change BLOG-URL to the URL or web address of your Blog. You can also change the text in top of your search box by changing SEARCH HERE to your Blog-url or what you like.

Now you only need to save and refresh you blog to see the result. You can change the length of the search box by changing "20" to another integer. A lower number will result in a short search box and a higher in a longer search box. You can always try to change to get the search box to fit you blog layout.

No comments:

Post a Comment