Wednesday, June 3, 2009

How to embed a google search engine in your blog

How?

Step 1:
Click Customize -> Layout -> Page Elements -> add a Gadget
Step 2:
Selet the "HTML/Javascript", in the textarea copy and paste either the "code for radio style search box" or "code for checkbox style search box" listed below.
Step 3:
Change the following fields accordingly:
<input type="radio" name="sitesearch" value="YOURSITE" checked />YOUR SITE<br />

<input type="checkbox" name="sitesearch" value="YOURSITE" checked /> only search YOUR SITE<br />

Step 4:
Save the change and Done.




only search Cyber Jedi


code for radio style search box:

<form method="get" action="http://www.google.com/search" target="_blank">
<input type="text" name="q" size="25" maxlength="255" value="" />
<input type="submit" value="Google Search" />
<input type="checkbox" name="sitesearch" value="cyberjedizen.blogspot.com" checked /> only search Cyber Jedi<br />
</form>





The Web Cyber Jedi


code for checkbox style search box:

<form method="get" action="http://www.google.com/search" target="_blank">
<input type="text" name="q" size="31" maxlength="255" value="" />
<input type="submit" value="Google Search" />
<input type="radio" name="sitesearch" value="" /> The Web<input type="radio" name="sitesearch" value="cyberjedizen.blogspot.com" checked /> Cyber Jedi<br />
</form>

Why?
The basic technique involved here is to be able to manipulate one of the variables handed to the Google search engine, a variable called sitesearch. Set it to a null value and you're searching the entire World Wide Web, but set it to a specific domain and it's constrained to to the domain.

You can either use radio button or check box for the sitesearch field. Notice the target="_blank" in the <form> tab, which create a pop up window instead of let the user clicking away from your site.


[ Supporting files]
[ Socialize This]

No comments:

Post a Comment

Why I stopped publishing blog posts as information provider

Now the AI can generate content. Does that mean the web publishing industry reaches the end? ChatGPT said: ChatGPT Not at all. While AI can ...