Difference between revisions of "Template:Google custom"

From blackwiki
Jump to navigation Jump to search
imported>Teratornis
(A template for generating links to Google custom search (to search a specific Web site))
 
imported>Teratornis
(typo, extra noinclude tag)
Line 1: Line 1:
<span class="plainlinks">[http://www.google.com/custom?domains={{{1}}}&sitesearch={{{1}}}{{#if: {{{2|}}}|&q={{urlencode:{{{2|}}}}}}} {{{3|{{{2|{{{1|}}}}}}}}}]{{#if:{{NAMESPACE}}|{{ns:0}}|<span class="messagebox" style="padding: 0; font-size: xx-small; color: #000000;">''[[Template:Google]] should not be used in articles as Google links are not considered appropriate for an encyclopedia.''</span>}}</span><noinclude>
+
<span class="plainlinks">[http://www.google.com/custom?domains={{{1}}}&sitesearch={{{1}}}{{#if: {{{2|}}}|&q={{urlencode:{{{2|}}}}}}} {{{3|{{{2|{{{1|}}}}}}}}}]{{#if:{{NAMESPACE}}|{{ns:0}}|<span class="messagebox" style="padding: 0; font-size: xx-small; color: #000000;">''[[Template:Google custom]] should not be used in articles as Google links are not considered appropriate for an encyclopedia.''</span>}}</span><noinclude>
 
----
 
----
 
==Usage==
 
==Usage==
Line 50: Line 50:
 
[[Category:External link templates|Google custom]]
 
[[Category:External link templates|Google custom]]
 
[[Category:Search templates|Google custom]]
 
[[Category:Search templates|Google custom]]
</noinclude>
 
 
 
</noinclude>
 
</noinclude>

Revision as of 22:41, 3 November 2007

[1]


Usage

Creates a Google custom search link, which searches one site (and, optionally, pages with URLs containing one directory path in the site). (If you want to search on the entire Web, use {{Google}} instead.) This template takes three unnamed input parameters; you must supply the first one, and the last two are optional.

  1. A domain name, and optionally the first part of directory path (to specify one part of the site to search). This parameter becomes the values of the sitesearch= and domains= parameters in the resulting search URL. If the value ends in a directory path component, it evidently must end with a complete path component. For Wikipedia URLs, this would be everything up to a slash or a colon (including or not including the slash or colon has no effect on the resulting search). (Required.) Examples:
    • en.wikipedia.org — (search all of the English Wikipedia)
    • en.wikipedia.org/wiki/Wikipedia:Help_desk — (search the English Wikipedia Help desk)
    • en.wikipedia.org/wiki/Help: — (search the English Wikipedia's Help: namespace)
    • en.wikipedia.org/wiki/Help_ — (generates a search link that does not work: try it, evidently because no Wikipedia page URLs contain the string with a colon or a slash immediately after it)
  2. Your search term(s). (Optional.) If this parameter is empty, clicking on the resulting link generates a Google search form with an initially blank input field, ready to search on the site the first parameter specifies.
  3. Link text to display on your wiki page. (Optional.)
  • Note: do not use this template in articles (as Google search links are not appropriate in articles). The template is only for use in talk, discussion, and other process pages only. The template will produce an unpleasant warning if you attempt to use it in an article.

Examples

Type this To get this What it produces, or searches for
{{google custom|en.wikipedia.org||Search Wikipedia}} Search Wikipedia Blank form to search Wikipedia
{{google custom|en.wikipedia.org|google|Search Wikipedia for "google"}} Search Wikipedia for "google" Search Wikipedia for "google"
{{google custom|en.wikipedia.org/wiki/Wikipedia:||Search Wikipedia's Wikipedia: namespace}} Search Wikipedia's Wikipedia: namespace Blank form to search the Wikipedia: namespace
{{google custom|en.wikipedia.org/wiki/Wikipedia:Help_desk||Search Wikipedia Help desk}} Search Wikipedia Help desk Blank form to search the Wikipedia Help desk
{{google custom|en.wikipedia.org/wiki/Wikipedia:Wikipedia_Signpost||Search Wikipedia Signpost}} Search Wikipedia Signpost Blank form to search the Wikipedia Signpost
{{google custom|en.wikipedia.org/wiki/Category:||Search Wikipedia's Category namespace}} Search Wikipedia's Category namespace Blank form to search Wikipedia's Category: namespace
{{google custom|en.wikipedia.org/wiki/Help:||Search Wikipedia's Help: namespace}} Search Wikipedia's Help namespace Blank form to search Wikipedia's Help: namespace
{{google custom|en.wikipedia.org/wiki/Template:|google|Search Wikipedia's Template: namespace for "google"}} Search Wikipedia's Template: namespace for "google" Search Wikipedia's Template: namespace for "google"
{{google custom|meta.wikimedia.org||Search Meta-Wiki with Google}} Search Meta-Wiki with Google Blank form to search Meta-Wiki
{{google custom|www.mediawiki.org||Search MediaWiki.org with Google}} Search MediaWiki.org with Google Blank form to search MediaWiki.org

See also