July 30, 2007

A search widget for your blog

Over at Beautiful Beta, I found a wonderfully simple search widget which operates in a similar way to the "Search this blog" feature found in the navbar. You can easily implement this widget into your blog by using the widget installer below:

Install Blog search widget

This form will take you to Blogger where you can choose to install the search widget into your sidebar (or other element of your template). However, if you prefer to install the search widget manually, you should take the following steps:
  1. Go to Template>Layout in your Blogger Dashboard.
  2. Create a new HTML/Javascript element in your sidebar.
  3. Insert the following code into the widget:
    <p align="center"><form id="searchthis" action="/search" style="display:inline;" method="get"> <input id="search-box" name="q" size="25" type="text"/> <input id="search-btn" value="Search" type="submit"/> </form></p>
  4. Give your widget a title if you like (eg: "Search this Blog"), and click save. You should now have a fully functional search box in your blog's sidebar!

So, if you prefer something simpler than the Google blog search I wrote about before, this is surely the widget for you.

Technorati Tags: | | | |



View blog reactions


Related Posts by Categories



Post a Comment 10 Comments:

01 August 2007 16:21 Ankit Duseja said...

This hack was previously written on Digital Technology (http://dt.yogtec.com). If you have copied the code from there please mention a backlink to the particular post from where you copied.

01 August 2007 16:42 Amanda said...

Hello Ankit,

I actually got the code from Beautiful Beta (as referenced in my post) who wrote about this last year, and states that he got the code from Phydeaux.

Your blog features some great tips and tricks, so if ever I reference your posts I will be sure to post a backlink and proper credit as with other posts I have written.

19 March 2008 23:35 Googe said...

how can i make this work for a non-custom blogger hosted site

that is, how can i put this code on my indierockcafe.com website which does NOT use Blogpost or allow for Layout customization?

Thanks! Good site

09 April 2008 01:39 Jeeberman said...

Amanda,
How do you get your search results within your blog to only have the post titles appear like beautifulbeta?
Please Let me know, if you have any ideas. You can contact me at http://kontactr.com/user/bestwidgets

My site http://widgetsforfree.blogspot.com

10 April 2008 23:48 Amanda said...

Hello Jeeberman,

I remember coming across this hack a while back but can't remember how to implement it offhand.

When I find this again I will update with a link back to the resource for you.

Hope this will help!

Best wishes,

Amanda

12 April 2008 19:17 jeeberman said...

Amanda,
thanks a lot for responding so soon.
Best luck on finding the resource.

thanks,
-John

09 May 2008 05:41 Jeeberman said...

Hey check out my site: http://widgetsforfree.blogspot.com

I got the hack to work!

14 June 2008 05:24 . brenda . said...

Great!!!!! So happy to find the perfect search feature I could use. Thanks!!

11 July 2008 15:26 Anonymous said...

I inserted the code and it only searched the "search" category on my blog.

19 July 2008 21:28 Nate said...

Is there a way to right-align the search bar? I would like it flush with the right margin of my sidebar.

I took a guess that changing the part from "center" to "right" might do it, but no luck.

Post a Comment