Google の検索窓を作る

Googleの検索窓

コンテンツを追加ーHTMLを選択して下記のタグを入れてみましょう!

①Googleの検索窓

Google

②Googleの検索窓+サイト内検索

Google
WWW を検索 サイト内 を検索

Googleの検索窓 サイト内検索付き
「このサイト内を検索」にチェックを入れると
自分のサイトの中から検索したキーワードを拾ってきます。

①Googleの検索窓タグ(コピーしてお使い下さい)


<!-- Google  -->

<form method=get action="http://www.google.co.jp/search">

<table bgcolor="#FFFFFF"><tr><td>

<a href="http://www.google.co.jp/">

<img src="http://www.google.com/logos/Logo_40wht.gif" border="0" alt="Google" align="absmiddle"></a>

<input type=text name=q size=31 maxlength=255 value="">

<input type=hidden name=ie value=UTF-8>

<input type=hidden name=oe value=UTF-8>

<input type=hidden name=hl value="ja">

<input type=submit name=btnG value="Google 検索">

</td></tr></table>

</form>

<!-- Google -->


コピーしてきたソースが「Shift_JIS」の場合は、「utf-8」2ヶ所変更。

Jimdoの言語はutf-8で作られています。

ご自分で作られたホームページもutf-8ならそれに変更してください。

変更しないと検索結果が文字化けします。

最近のホームページは、ほとんどutf-8で作られています。

7行目のsize=31を小さくすると幅が小さくなる。

左メニューの下にもサイズ20にして検索窓入れてみました。

 

他にも「カスタム検索」という方法もありますが

この方法が簡単です。

②Googleの検索窓+サイト内検索

<!-- SiteSearch Google -->

<form method=get action="http://www.google.co.jp/search">

<table bgcolor="#FFFFFF"><tr valign=top><td>

<a href="http://www.google.co.jp/">

<img src="http://www.google.com/logos/Logo_40wht.gif" border="0" alt="Google" align="absmiddle"></a>

</td>

<td>

<input type=text name=q size=31 maxlength=255 value="">

<input type=hidden name=ie value=utf-8>

<input type=hidden name=oe value=utf-8>

<input type=hidden name=hl value="ja">

<input type=submit name=btnG value="Google 検索">

<font size=-1>

<input type=hidden name=domains value="minami2web.jimdo.com"><br>

<input type=radio name=sitesearch value=""> WWW を検索 

<input type=radio name=sitesearch value="minami2web.jimdo.com" checked> サイト内 を検索

</font>

</td></tr></table>

</form>

<!-- SiteSearch Google -->


value(言語)を「utf-8」に変更2ヶ所

後の赤文字には、自分のサイトURL2ヶ所

URLは「htto://」や最後の「/」は不要です。

Yahooの検索窓を作る

③YAHOOの検索窓

Yahoo! JAPAN

④YAHOOの検索窓+サイト内検索

Yahoo! JAPAN

  • ウェブ全体を検索
  • このサイト内を検索

③YAHOOの検索窓タグ(コピーしてお使い下さい)

<!-- Begin Yahoo Search Form -->

<div style="margin:0;padding:0;font-size:14pt;border:none;background-color:#FFF;">

<form action="http://search.yahoo.co.jp/search" method="get" target="_blank" style="margin:0;padding:0;">

<p style="margin:0;padding:0;"><a href="http://www.yahoo.co.jp/" target="_blank"><img src="http://i.yimg.jp/images/search/guide/searchbox/080318/ysearch_logo_85_22.gif" alt="Yahoo! JAPAN" style="border:none;vertical-align:middle;padding:0;border:0;" width="85" height="22"></a><input type="text" name="p" size="31"><input type="hidden" name="fr" value="yssw"><input type="hidden" name="ei" value="Shift_JIS"><input type="submit" value="検索" style="margin:0;"></p>

</form>

</div>

<!-- End Yahoo! Search Form -->

 

出来上がり!こんな感じ!Yahooの検索窓
Yahooの場合も赤文字の「Shift_JISのところを「utf-8」に変更して下さい。

④Yahooの検索窓+サイト内検索

<!-- Begin Yahoo Search Form -->

 

<div style="margin:0;padding:0;font-size:14pt;border:none;background-color:#FFF;">

    <form action="http://search.yahoo.co.jp/search" method="get" target="_blank" style="margin:0;padding:0;">

        <p style="margin:0;padding:0;">

            <a href="http://www.yahoo.co.jp/" target="_blank"><img src="http://i.yimg.jp/images/search/guide/searchbox/080318/ysearch_logo_85_22.gif" alt="Yahoo! JAPAN" style=

            "border:none;vertical-align:middle;padding:0;border:0;" width="85" height="22" /></a><input type="text" name="p" size="31" /><input type="hidden" name="fr" value="ysiw" /><input type=

            "hidden" name="ei" value="utf-8" /><input type="submit" value="検索" style="margin:0;" />

        </p>

 

        <ul style="margin:2px 0 0 0;padding:0;font-size:12pt;list-style:none;">

            <li style="display:inline;">

                <input name="vs" type="radio" value="" checked="checked" />ウェブ全体を検索

            </li>

 

            <li style="display:inline;">

                <input name="vs" type="radio" value="●●●" />このサイト内を検索

            </li>

        </ul>

    </form>

</div>

<!-- End Yahoo! Search Form -->

赤文字のところを書き換えています。
検索窓の下の文字が小さいのでfont-sizeを10→12に変更
●●●」は自分のサイト名ここでは「minami2web.jimdo.com」に変更
「http://」や最後の「/」は不要です。