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

From blackwiki
Jump to navigation Jump to search
imported>Mr. Stradivarius on tour
(Update example code to use subpagename when transcluded)
imported>Mr. Stradivarius on tour
(Update and expand)
Line 2: Line 2:
 
<!-- 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 a series of links to various search interfaces to help find additional reference material for articles. It is based on the {{tl|find sources multi}} meta-template. This template should not be used in articles themselves - see [[Wikipedia:EL#Links normally to be avoided]].
+
This template produces {{#switch: {{SUBPAGENAME}}
 +
| g          = a [[Google]]
 +
| gnews      = a [[Google News]]
 +
| gbooks      = a [[Google Books]]
 +
| 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]]
 +
| wrt        = 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>
  
 
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).
Line 10: Line 26:
 
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. 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''.
  
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).
+
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 {{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.
 +
| .
 +
}}
 +
 
 +
== Examples ==
 +
 
 +
*Simple search:
 +
:<code><nowiki>{{Find sources multi/</nowiki><includeonly>{{SUBPAGENAME}}</includeonly><noinclude>g</noinclude><nowiki>|Albert Einstein}}</nowiki></code>
 +
 
 +
:produces:
  
If {{para|free|yes}} is added, Google News 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.
+
:{{Find sources multi/<includeonly>{{SUBPAGENAME}}</includeonly><noinclude>g</noinclude> |Albert Einstein}}
  
*Simple example:
+
*Complex search:
:<code><nowiki>{{Find sources multi/</nowiki><includeonly>{{SUBPAGENAME}}</includeonly><noinclude>all</noinclude><nowiki>|Albert Einstein}}</nowiki></code>
+
:<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>
  
 
:produces:
 
:produces:
  
:{{Find sources multi/<includeonly>{{SUBPAGENAME}}</includeonly><noinclude>all</noinclude> |Albert Einstein}}
+
:{{Find sources multi/<includeonly>{{SUBPAGENAME}}</includeonly><noinclude>g</noinclude> |Albert Einstein|physics|-"Marilyn Monroe"|relativity|science|free=yes}}
  
*Complex example:
+
*Custom display text
:<code><nowiki>{{Find sources multi/</nowiki><includeonly>{{SUBPAGENAME}}</includeonly><noinclude>all</noinclude><nowiki>|Albert Einstein|physics|-"Marilyn Monroe"|relativity|science|free=yes}}</nowiki></code>
+
 
 +
:<code><nowiki>{{Find sources multi/</nowiki><includeonly>{{SUBPAGENAME}}</includeonly><noinclude>g</noinclude><nowiki>|Albert Einstein|display=Custom display text}}</nowiki></code>
  
 
:produces:
 
:produces:
  
:{{Find sources multi/<includeonly>{{SUBPAGENAME}}</includeonly><noinclude>all</noinclude> |Albert Einstein|physics|-"Marilyn Monroe"|relativity|science|free=yes}}
+
:{{Find sources multi/<includeonly>{{SUBPAGENAME}}</includeonly><noinclude>g</noinclude> |Albert Einstein|display=Custom display text}}
 +
 
 +
== See also ==
 +
 
 +
{{find sources multi/doc/linktable}}
 +
 
 +
This documentation is generated by {{tl|find sources multi/doc/links}}.
  
 
<includeonly>
 
<includeonly>

Revision as of 07:22, 12 March 2013


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. Then 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

  • 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

This documentation is generated by {{find sources multi/doc/links}}.