Difference between revisions of "Template:Find sources multi/doc/links"

From blackwiki
Jump to navigation Jump to search
imported>Mr. Stradivarius on tour
(Fix wrt --> wrs)
imported>Dpleibovitz
(SUBPAGE -> SUBPAGENAME)
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{Documentation subpage}}
 
{{Documentation subpage}}
{{#switch: {{SUBPAGENAME}}
+
{{#if: {{find sources multi/linkinfo|1={{SUBPAGENAME}}|2=shortcut1}}
| g          = {{template shortcut|gfind|findg|fsmulti/g}}
+
  | {{template shortcut  
| gnews      = {{template shortcut|findgn|fsmulti/gn}}
+
    |1= {{find sources multi/linkinfo|1={{SUBPAGENAME}}|2=shortcut1}}
  | gbooks      = {{template shortcut|findgb|fsmulti/gb}}
+
    |2= {{find sources multi/linkinfo|1={{SUBPAGENAME}}|2=shortcut2}}
| gscholar    = {{template shortcut|findgs|fsmulti/gs}}
+
    |3= {{find sources multi/linkinfo|1={{SUBPAGENAME}}|2=shortcut3}}
| jstor      = {{template shortcut|findjstor|fsmulti/jstor}}
+
   }}
| gfreeimages = {{template shortcut|findgfi|fsmulti/gfi}}
 
| archive    = {{template shortcut|findia|fsmulti/ia}}
 
| bing        = {{template shortcut|findbing|fsmulti/bing}}
 
| gnewsrecent = {{template shortcut|findgnr|fsmulti/gnr}}
 
| nyt        = {{template shortcut|findnyt|fsmulti/nyt}}
 
| wrs        = {{template shortcut|findwrs|fsmulti/wrs}}
 
| ddg        = {{template shortcut|findddg|fsmulti/ddg}}
 
| #default   =
 
 
}}
 
}}
 
<!-- Categories go at the bottom of this page and interwikis go in Wikidata. -->
 
<!-- Categories go at the bottom of this page and interwikis go in Wikidata. -->
  
This template produces {{#switch: {{SUBPAGENAME}}
+
{{#if: {{find sources multi/linkinfo|1={{SUBPAGENAME}}|2=t_description}}
| g          = a [[Google]]
+
  | {{find sources multi/linkinfo|1={{SUBPAGENAME}}|2=t_description}}
  | gnews      = a [[Google News]]
+
  | This template produces a search link to help find additional reference material for articles.
| gbooks      = a [[Google Books]]
+
}} It is part of the {{tl|find sources multi}} meta-template, but it can also be used on its own. This template should not be used in articles themselves - see [[Wikipedia:EL#Links normally to be avoided]].
| gscholar    = a [[Google Scholar]]
 
  | jstor      = a [[JSTOR]]
 
| gfreeimages = a free-use [[Google Images]]
 
| archive    = a [[Internet Archive]]
 
| bing        = a [[Bing]]
 
| gnewsrecent = a recent [[Google News]]
 
| nyt        = a [[New York Times]]
 
| wrs        = a [[WP:WRS]]
 
| ddg        = a [[DuckDuckGo]]
 
| #default    = a
 
}} search link to help find additional reference material for articles. It is part of the {{tl|find sources multi}} meta-template, but it can also be used on its own. This template should not be used in articles themselves - see [[Wikipedia:EL#Links normally to be avoided]].
 
  
 
== Usage ==
 
== Usage ==
  
:<code><nowiki>{{Find sources multi/</nowiki><includeonly>{{SUBPAGENAME}}</includeonly><noinclude>g</noinclude><nowiki>|</nowiki>''search term 1''<nowiki>|</nowiki>''search term 2''<nowiki>|</nowiki>''search term 3''<nowiki>|</nowiki>''search term 4''<nowiki>|</nowiki>''search term 5''<nowiki>|display=</nowiki>''custom display text''{{#ifeq: {{SUBPAGE}} | gnews | <nowiki>|free=</nowiki>''yes'' }}<nowiki>}}</nowiki></code>
+
:<code><nowiki>{{Find sources multi/</nowiki><includeonly>{{SUBPAGENAME}}</includeonly><noinclude>g</noinclude><nowiki>|</nowiki>''search term 1''<nowiki>|</nowiki>''search term 2''<nowiki>|</nowiki>''search term 3''<nowiki>|</nowiki>''search term 4''<nowiki>|</nowiki>''search term 5''<nowiki>|display=</nowiki>''custom display text''{{#ifeq: {{SUBPAGENAME}} | gnews | <nowiki>|free=</nowiki>''yes'' }}<nowiki>}}</nowiki></code>
  
 
The first parameter is the main search term, which will be treated as a [[literal string]] if multi-part (e.g. <code>Albert Einstein</code> will be searched as the single string "Albert Einstein" not "Albert" and "Einstein" separately).
 
The first parameter is the main search term, which will be treated as a [[literal string]] if multi-part (e.g. <code>Albert Einstein</code> will be searched as the single string "Albert Einstein" not "Albert" and "Einstein" separately).
  
Optional subsequent parameters (up to 4) are additional search terms. Then can be enclosed in double quotation marks, preceded by an unspaced <code>-</code> (hyphen) to exclude them from the search results, or both (e.g. <code>-"Marilyn Monroe"</code> to exclude matches containing the phrase "Marilyn Monroe", but not either name by itself, from the search results).  You do ''not'' need to add <code>-wikipedia</code>, as the template automatically does this for you. Also, there is no need to add words in plural form unless irregular, as the search interface will match (for example) ''billiards'' as well given a search term of ''billiard''.
+
Optional subsequent parameters (up to 4) are additional search terms. They can be enclosed in double quotation marks, preceded by an unspaced <code>-</code> (hyphen) to exclude them from the search results, or both (e.g. <code>-"Marilyn Monroe"</code> to exclude matches containing the phrase "Marilyn Monroe", but not either name by itself, from the search results).  You do ''not'' need to add <code>-wikipedia</code>, as the template automatically does this for you. Also, there is no need to add words in plural form unless irregular, as the search interface will match (for example) ''billiards'' as well given a search term of ''billiard''.
  
If no parameters are given, the name of the article is passed as the search string. Note that this may or may not be desirable with disambiguated article names (if the Wikipedia disambiguator is sensible, however, it may actually help refine the search results){{#ifeq: {{SUBPAGE}} | gnews | .
+
If no parameters are given, the name of the article is passed as the search string. Note that this may or may not be desirable with disambiguated article names (if the Wikipedia disambiguator is sensible, however, it may actually help refine the search results){{#ifeq: {{SUBPAGENAME}} | gnews | .
  
 
If {{para|free|yes}} is added, the template will only return free search results; please note that this can exclude many valuable sources simply because they have a small (or sometimes not so small) price tag; this parameter is best used when linking to source material in discussions, rather than when using the template near the top of an article's talk page as a source-finding resource.
 
If {{para|free|yes}} is added, the template will only return free search results; please note that this can exclude many valuable sources simply because they have a small (or sometimes not so small) price tag; this parameter is best used when linking to source material in discussions, rather than when using the template near the top of an article's talk page as a source-finding resource.
Line 48: Line 29:
  
 
== Examples ==
 
== Examples ==
 +
 +
*Default search:
 +
:<code><nowiki>{{Find sources multi/</nowiki><includeonly>{{SUBPAGENAME}}</includeonly><noinclude>g</noinclude><nowiki>}}</nowiki></code>
 +
 +
:produces:
 +
 +
:{{Find sources multi/<includeonly>{{SUBPAGENAME}}</includeonly><noinclude>g</noinclude>}}
  
 
*Simple search:
 
*Simple search:
Line 57: Line 45:
  
 
*Complex search:
 
*Complex search:
:<code><nowiki>{{Find sources multi/</nowiki><includeonly>{{SUBPAGENAME}}</includeonly><noinclude>g</noinclude><nowiki>|Albert Einstein|physics|-"Marilyn Monroe"|relativity|science</nowiki>{{#ifeq: {{SUBPAGE}} | gnews | <nowiki>|free=yes</nowiki> }}<nowiki>}}</nowiki></code>
+
:<code><nowiki>{{Find sources multi/</nowiki><includeonly>{{SUBPAGENAME}}</includeonly><noinclude>g</noinclude><nowiki>|Albert Einstein|physics|-"Marilyn Monroe"|relativity|science</nowiki>{{#ifeq: {{SUBPAGENAME}} | gnews | <nowiki>|free=yes</nowiki> }}<nowiki>}}</nowiki></code>
  
 
:produces:
 
:produces:
Line 74: Line 62:
  
 
{{find sources multi/doc/linktable}}
 
{{find sources multi/doc/linktable}}
 +
{{#if: {{find sources multi/linkinfo|1={{SUBPAGENAME}}|2=code}}
 +
|
 +
<!-- Categories for the daughter templates go here, and interwikis go in Wikidata -->
 +
[[Category:Source-finding templates|{{PAGENAME}}]]
 +
[[Category:Find sources multi subtemplates|{{PAGENAME}}]]
 +
}}<noinclude>
  
This documentation is generated by {{tl|find sources multi/doc/links}}.
+
{{documentation|content=
  
<includeonly>
+
This template is used to provide documentation for the link subtemplates of {{tl|find sources multi}}. It detects the subtemplate name automatically, and uses {{tl|find sources multi/linkinfo}} to generate the template shortcut values and link descriptions.
<!-- Categories go here, and interwikis go in Wikidata -->
+
 
[[Category:Source-finding templates|{{PAGENAME}}]]
+
== Usage ==
[[Category:Wikipedia metatemplates|{{PAGENAME}}]]
+
This template should be transcluded at the bottom of the link subtemplates like this:
</includeonly>
+
 
 +
<pre><!--End of the link subtemplate code-->&lt;noinclude&gt;
 +
 
 +
{{documentation|Template:Find sources multi/doc/links}}
 +
&lt;/noinclude&gt;</pre>
 +
 
 +
}}
 +
<!-- Categories for this template go here, and interwikis go in Wikidata -->
 +
[[Category:Find sources multi subtemplates|{{PAGENAME}}]]
 +
 
 +
</noinclude>

Latest revision as of 19:13, 20 February 2014


This template produces a search link to help find additional reference material for articles. It is part of the {{find sources multi}} meta-template, but it can also be used on its own. This template should not be used in articles themselves - see Wikipedia:EL#Links normally to be avoided.

Usage

{{Find sources multi/g|search term 1|search term 2|search term 3|search term 4|search term 5|display=custom display text}}

The first parameter is the main search term, which will be treated as a literal string if multi-part (e.g. Albert Einstein will be searched as the single string "Albert Einstein" not "Albert" and "Einstein" separately).

Optional subsequent parameters (up to 4) are additional search terms. They can be enclosed in double quotation marks, preceded by an unspaced - (hyphen) to exclude them from the search results, or both (e.g. -"Marilyn Monroe" to exclude matches containing the phrase "Marilyn Monroe", but not either name by itself, from the search results). You do not need to add -wikipedia, as the template automatically does this for you. Also, there is no need to add words in plural form unless irregular, as the search interface will match (for example) billiards as well given a search term of billiard.

If no parameters are given, the name of the article is passed as the search string. Note that this may or may not be desirable with disambiguated article names (if the Wikipedia disambiguator is sensible, however, it may actually help refine the search results).

Examples

  • Default search:
{{Find sources multi/g}}
produces:
Google
  • Simple search:
{{Find sources multi/g|Albert Einstein}}
produces:
Google
  • Complex search:
{{Find sources multi/g|Albert Einstein|physics|-"Marilyn Monroe"|relativity|science}}
produces:
Google
  • Custom display text
{{Find sources multi/g|Albert Einstein|display=Custom display text}}
produces:
Custom display text

See also


50px Template documentation

This template is used to provide documentation for the link subtemplates of {{find sources multi}}. It detects the subtemplate name automatically, and uses {{find sources multi/linkinfo}} to generate the template shortcut values and link descriptions.

Usage

This template should be transcluded at the bottom of the link subtemplates like this:

<!--End of the link subtemplate code--><noinclude>

{{documentation|Template:Find sources multi/doc/links}}
</noinclude>