Template:Gs/doc
Documentation
This template provides a convenient way of linking to a Google search. It properly URL-encodes its input and makes it obvious that the link is to another website. Pages containing calls to this template (possibly provided via other templates) can be found by using the "WhatLinksHere" feature.
The template does not complain about missing input; instead, it uses the name of the page calling the template as the search query if no other text has been specified, as seen above (the name of this template page is "Gs").
The name of the template is based on the phrase "Google search".
Usage
Common forms (other combinations are possible):
{{gs|search string}}{{gs|search string|site=website to search in}}{{gs|search string|linked text}}{{gs|search string|encl=char}}{{gs|search string|open=char|close=char}}
Note that char stands for "character", although these parameter values do not actually need to be single characters (but they usually are).
The encl [referring to "enclosure" or "enclosing character(s)"] and open/close parameters can be used for quotation marks and the like, so these things will appear before the little "leaving the wiki" indicator but outside of the link itself (see examples below). Any combination of these three parameters can be used together (for example, you could use encl and close without open, if that's necessary for some reason).
All parameters
{{gs|||site=|open=|close=|encl=}}
Examples
{{gs|Willie Nelson}}⇒ Willie Nelson↗{{gs|Gloomy Sunday|encl="}}⇒ "Gloomy Sunday"↗{{gs|Norske Talenter|open=«|close=»}}⇒ «Norske Talenter»↗{{gs|Norske Talenter|open=«|close=»|encl="}}⇒ "«Norske Talenter»"↗{{gs|Norske Talenter|site=vg.no}}⇒ Norske Talenter↗{{gs|Norske Talenter|site=tv2.no}}⇒ Norske Talenter↗
(The fourth example is there just for "completeness": to show the order of the encl and open/close parameters, when used together.)
Other ways of using quotation marks that don't work as well
"{{w|Gloomy Sunday}}"⇒ "Gloomy Sunday↗"{{w|"Gloomy Sunday"}}⇒ "Gloomy Sunday"↗{{w|Gloomy Sunday|"Gloomy Sunday"}}⇒ "Gloomy Sunday"↗"[//en.wikipedia.org/wiki/Gloomy_Sunday Gloomy Sunday]"⇒ "Gloomy Sunday"[//en.wikipedia.org/wiki/Gloomy_Sunday "Gloomy Sunday"]⇒ "Gloomy Sunday"
These last two examples use external links, just for comparison.
The link in the second example is broken at Wikipedia (the relevant article there does not have quotation marks). The first and fourth just look weird. The third and fifth look and work fine, but are tedious to implement (and a bit error-prone).
<include only> </includeonly>