Tuesday, July 22, 2008

Help Your Readers Search Your Blog

After your blog starts to get bigger, you'll want your readers to be able to find the content easier, sometimes looking for more detail than can be found in the Archives index. You can generally use Labels for a more comprehensive index of the blog contents, but both labels and titles index the posts based on your vision of the blog. What if you want your readers to view your blog, on their terms?

This is where the Navbar, with its search box, becomes useful. That's assuming that you don't block the Navbar, and assuming that your readers like using the Navbar. But you're not confined to using the Search box on the Navbar - you can make your own search box, and position it where you like.

Setup a new HTML / JavaScript gadget, to get a very simple search box for your blog.





Just copy the code to the new gadget.

<form action="/search" method="get">
<input name="q" type="text"/>
<input value="Search This Blog" type="submit"/>
</form>

Having setup your new gadget, you can position it anywhere on the page. Or, you can have a search box inside a post, as I show above. That's your choice.

You can get way more fancy, for instance search multiple blogs at once, using a Google Custom Search box, but for a 5 minute blog upgrade, this is all that you need.
  • Search only your blog.
  • Search your blog directly, not from search engine cache. No waiting for search engine updates.
  • Display search results as part of the blog display, with all blog accessories and decorations visible.
This is very user friendly - your readers will appreciate it.

>> Top

9 comments:

Arizona Steve said...

Hey, do you know of any way for ftp published blogs to add a search box like this? We don't get access to all the nifty Blogger elements. :(

Chuck said...

Steve,

This feature is plain old JavaScript, which will work fine in a Classic template. You will have to edit the template HTML, but beyond that issue, it's perfectly doable.

Peg in South Carolina said...

Thank you! I did it and it's neat.

Elaine Garrett said...

I just discovered your series of posts on adding this search to my blogspot blog. Understand that I'm not tech savvy. I went into "Add a Gadget" but could not locate "Find and select "HTML/JavaScript".

I've copied and saved the code. Hope you can direct me to where it goes.

Chuck said...

Elaine,

I don't enjoy the disarray of the list in "Add a Gadget", but "HTML/JavaScript" is in the "Basics" list, a bit more than half way down (right now). You'll have to look very carefully.

Jim Davis said...

I'm trying to set up a search box for an ftp published blog but I can't get it to work. I tried replacing "/search" with my URL/search and got nowhere. I set up a directory named "search" but got nowhere again. Obviously I need to learn a lot more. I'll appreciate any help.

Thanks,

Jim

Chuck said...

Jim,

With BlogSpot / Google published blogs, there's a standard folder URL structure. This pos, for instance, is "blogging.nitecruzr.net/2008/07/help-your-readers-search-your-blog.html", and it's in folder "/2008/07". The search term "/" directs the search to start at the root, ie at the level above "2008".

If you publish your main page to the root of your blog, with the archives under it ("2009", "2008", etc), I would think that a search of "/" should work. Unless the search only works for dynamically published blogs (BlogSpot / custom domain).

Ames Swartsfager said...

I have completed setting up my blog, but it does not come up when I search for it on the net. It is written(published/) for BlogSpot.com, Google. What do I need to do to launch on the net??
Ames in CT.

Chuck said...

Ames,

You launch your blog on the net with lots of hard work.

Post a Comment

Welcome to Nitecruzr Dot Net, and The Real Blogger Status. If this is your first visit here, please help me to help you, and read my commenting policy.

You can request technical assistance here - but you'll get better help in Blogger Help Forum, or in my personal forum Nitecruzr Dot Net - Blogging, where you benefit from peer support.

Do not post your email address in the body of your comment, unless you wish for it to be visible to the world.

Note if you wish to leave a comment, you'll have to enable third party cookies.