Difference between revisions of "Template:Find sources multi/linkinfo"
Jump to navigation
Jump to search
Template documentation
imported>Mr. Stradivarius (Add notes, misc fixes) |
imported>Elegie (Use HTTPS for link to Thibbs' custom Google Search) |
||
| (9 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
| − | {{<includeonly>safesubst:</includeonly>#switch: {{{1}}} | + | <noinclude><!-- |
| + | =========================================================================================== | ||
| + | This template provides information about the link subtemplates of {{find sources multi}}. | ||
| + | Please stick to the example format shown below when updating the links. Also, if you are | ||
| + | adding link number 21, please contact [[User:Mr. Stradivarius]] (or if he's not around, | ||
| + | someone who knows advanced template coding) as some changes will need to be made to the | ||
| + | template's back-end before your new data can be used. | ||
| + | =========================================================================================== | ||
| + | --></noinclude>{{<includeonly>safesubst:</includeonly>#switch: {{{1}}} | ||
| <!-- linkn --> | <!-- ln --> | <!-- code --> = {{<includeonly>safesubst:</includeonly>#switch: {{{2}}} | | <!-- linkn --> | <!-- ln --> | <!-- code --> = {{<includeonly>safesubst:</includeonly>#switch: {{{2}}} | ||
| − | | code | + | | code = <!-- the main link code; this must be the exact subpage name of the link template --> |
| alias1 = <!-- alias1 to alias4 are aliases for the main link code --> | | alias1 = <!-- alias1 to alias4 are aliases for the main link code --> | ||
| alias2 = | | alias2 = | ||
| Line 16: | Line 24: | ||
| link1 | l1 | g = {{<includeonly>safesubst:</includeonly>#switch: {{{2}}} | | link1 | l1 | g = {{<includeonly>safesubst:</includeonly>#switch: {{{2}}} | ||
| − | | code | + | | code = g |
| alias1 = google | | alias1 = google | ||
| alias2 = | | alias2 = | ||
| Line 22: | Line 30: | ||
| alias4 = | | alias4 = | ||
| t_description = This template provides a search link to [[Google]] to help find sources for articles. | | t_description = This template provides a search link to [[Google]] to help find sources for articles. | ||
| − | | se_description = [[Google]], the | + | | se_description = [[Google]], the flagship search engine from Google Inc. |
| shortcut1 = gfind | | shortcut1 = gfind | ||
| shortcut2 = findg | | shortcut2 = findg | ||
| Line 30: | Line 38: | ||
| link2 | l2 | gnews = {{<includeonly>safesubst:</includeonly>#switch: {{{2}}} | | link2 | l2 | gnews = {{<includeonly>safesubst:</includeonly>#switch: {{{2}}} | ||
| − | | code | + | | code = gnews |
| alias1 = gn | | alias1 = gn | ||
| alias2 = | | alias2 = | ||
| Line 40: | Line 48: | ||
| shortcut2 = fsmulti/gn | | shortcut2 = fsmulti/gn | ||
| shortcut3 = | | shortcut3 = | ||
| − | | notes = Can be used with {{para|free|yes}} to return free results only. | + | | notes = Can be used with {{para|free|yes}} to return free results only. {{red|1=Google News search [//en.wikipedia.org/w/index.php?title=Wikipedia:Village_pump_%28miscellaneous%29&oldid=586050946#Google_news_archive_search.3F does not work] as of December 2013.}} |
}} | }} | ||
| link3 | l3 | gbooks = {{<includeonly>safesubst:</includeonly>#switch: {{{2}}} | | link3 | l3 | gbooks = {{<includeonly>safesubst:</includeonly>#switch: {{{2}}} | ||
| − | | code | + | | code = gbooks |
| alias1 = gb | | alias1 = gb | ||
| alias2 = | | alias2 = | ||
| Line 58: | Line 66: | ||
| link4 | l4 | gscholar = {{<includeonly>safesubst:</includeonly>#switch: {{{2}}} | | link4 | l4 | gscholar = {{<includeonly>safesubst:</includeonly>#switch: {{{2}}} | ||
| − | | code | + | | code = gscholar |
| alias1 = gs | | alias1 = gs | ||
| alias2 = | | alias2 = | ||
| Line 73: | Line 81: | ||
| link5 | l5 | jstor = {{<includeonly>safesubst:</includeonly>#switch: {{{2}}} | | link5 | l5 | jstor = {{<includeonly>safesubst:</includeonly>#switch: {{{2}}} | ||
| − | | code | + | | code = jstor |
| alias1 = | | alias1 = | ||
| alias2 = | | alias2 = | ||
| Line 87: | Line 95: | ||
| link6 | l6 | gfreeimages = {{<includeonly>safesubst:</includeonly>#switch: {{{2}}} | | link6 | l6 | gfreeimages = {{<includeonly>safesubst:</includeonly>#switch: {{{2}}} | ||
| − | | code | + | | code = gfreeimages |
| alias1 = gfi | | alias1 = gfi | ||
| alias2 = | | alias2 = | ||
| Line 101: | Line 109: | ||
| link7 | l7 | archive = {{<includeonly>safesubst:</includeonly>#switch: {{{2}}} | | link7 | l7 | archive = {{<includeonly>safesubst:</includeonly>#switch: {{{2}}} | ||
| − | | code | + | | code = archive |
| alias1 = ia | | alias1 = ia | ||
| alias2 = | | alias2 = | ||
| Line 115: | Line 123: | ||
| link8 | l8 | bing = {{<includeonly>safesubst:</includeonly>#switch: {{{2}}} | | link8 | l8 | bing = {{<includeonly>safesubst:</includeonly>#switch: {{{2}}} | ||
| − | | code | + | | code = bing |
| alias1 = msbooks | | alias1 = msbooks | ||
| alias2 = msacademic | | alias2 = msacademic | ||
| Line 129: | Line 137: | ||
| link9 | l9 | gnewsrecent = {{<includeonly>safesubst:</includeonly>#switch: {{{2}}} | | link9 | l9 | gnewsrecent = {{<includeonly>safesubst:</includeonly>#switch: {{{2}}} | ||
| − | | code | + | | code = gnewsrecent |
| alias1 = gnr | | alias1 = gnr | ||
| alias2 = | | alias2 = | ||
| Line 143: | Line 151: | ||
| link10 | l10 | nyt = {{<includeonly>safesubst:</includeonly>#switch: {{{2}}} | | link10 | l10 | nyt = {{<includeonly>safesubst:</includeonly>#switch: {{{2}}} | ||
| − | | code | + | | code = nyt |
| alias1 = nytrecent | | alias1 = nytrecent | ||
| alias2 = nytold | | alias2 = nytold | ||
| Line 157: | Line 165: | ||
| link11 | l11 | wrs = {{<includeonly>safesubst:</includeonly>#switch: {{{2}}} | | link11 | l11 | wrs = {{<includeonly>safesubst:</includeonly>#switch: {{{2}}} | ||
| − | | code | + | | code = wrs |
| alias1 = | | alias1 = | ||
| alias2 = | | alias2 = | ||
| Line 171: | Line 179: | ||
| link12 | l12 | ddg = {{<includeonly>safesubst:</includeonly>#switch: {{{2}}} | | link12 | l12 | ddg = {{<includeonly>safesubst:</includeonly>#switch: {{{2}}} | ||
| − | | code | + | | code = ddg |
| alias1 = | | alias1 = | ||
| alias2 = | | alias2 = | ||
| Line 183: | Line 191: | ||
| notes = | | notes = | ||
}} | }} | ||
| + | |||
| + | | link13 | l13 | vgrs = {{<includeonly>safesubst:</includeonly>#switch: {{{2}}} | ||
| + | | code = vgrs | ||
| + | | alias1 = | ||
| + | | alias2 = | ||
| + | | alias3 = | ||
| + | | alias4 = | ||
| + | | t_description = This template provides a search link to [[User:Thibbs|Thibbs]]' [https://www.google.com/cse/home?cx=003516479746865699832:leawcwkqifq Google RS], a [[custom Google search engine]] that limits the search to sites listed in [[Wikipedia:WikiProject Video games/Sources]]. | ||
| + | | se_description = [[User:Thibbs|Thibbs]]' [http://www.google.com/cse/home?cx=003516479746865699832:leawcwkqifq Google RS], a [[custom Google search engine]] that limits the search to sites listed in [[Wikipedia:WikiProject Video games/Sources]]. | ||
| + | | shortcut1 = findvgrs | ||
| + | | shortcut2 = fsmulti/vgrs | ||
| + | | shortcut3 = | ||
| + | | notes = | ||
| + | }} | ||
| + | |||
| + | | link14 | l14 | gnewspapers = {{<includeonly>safesubst:</includeonly>#switch: {{{2}}} | ||
| + | | code = gnewspapers | ||
| + | | alias1 = gnewspaper | ||
| + | | alias2 = gnp | ||
| + | | alias3 = | ||
| + | | alias4 = | ||
| + | | t_description = This template provides a search link to Google's newspaper archive search. | ||
| + | | se_description = Google Newspapers, a search of Google's digital archive of print newspapers. | ||
| + | | shortcut1 = findgnewspapers | ||
| + | | shortcut2 = fsmulti/gnewspapers | ||
| + | | shortcut3 = | ||
| + | | notes = | ||
| + | }} | ||
| + | |||
| + | }}<noinclude> | ||
| + | {{documentation|content= | ||
| + | |||
| + | This template stores data about the various search link subtemplates of {{tl|find sources multi}}. | ||
| + | |||
| + | == Usage == | ||
| + | |||
| + | The template takes two positional parameters. | ||
| + | |||
| + | * The first positional parameter specifies the subtemplate for which data is requested. It may take the value of the subpage name of the link template (e.g. <code>gnews</code>), a value of ''linkn'' (<code>link1</code>, <code>link2</code>, etc.), or its alias ''ln'' (<code>l1</code>, <code>l2</code>, etc.). | ||
| + | * The second positional parameter specifies what type of data is requested. It can take the following values: | ||
| + | ** <code>code</code> - The main link code. This is the same as the subpage name of the link template. | ||
| + | ** <code>alias1</code> - An alias for the main link code. The subpage of [[Template:Find sources multi]] with this value is a redirect to the link template. | ||
| + | ** <code>alias2</code> - Another alias for the main link code. | ||
| + | ** <code>alias3</code> - A third alias for the main link code. | ||
| + | ** <code>alias4</code> - A fourth alias for the main link code. | ||
| + | ** <code>t_description</code> - A short description of the template. | ||
| + | ** <code>se_description</code> - A short description of the search engine that the template uses. | ||
| + | ** <code>shortcut1</code> - A template shortcut for the link template. | ||
| + | ** <code>shortcut2</code> - A second template shortcut for the link template. | ||
| + | ** <code>shortcut3</code> - A third template shortcut for the link template. | ||
| + | ** <code>notes</code> - Notes about of the link template. | ||
| + | |||
| + | The template will only output data if the following three conditions are all true: | ||
| + | # The first positional parameter has a valid value. | ||
| + | # The second positional parameter has a valid value. | ||
| + | # The data field specified by the first and second positional parameters is not empty. | ||
| + | Otherwise, the template will return a null value. | ||
| + | |||
| + | == Examples == | ||
| + | |||
| + | ;Example 1 | ||
| + | |||
| + | :<code><nowiki>{{find sources multi/linkinfo|link1}}</nowiki></code> | ||
| + | :produces: | ||
| + | :{{find sources multi/linkinfo|link1}} | ||
| + | |||
| + | ;Example 2 | ||
| + | |||
| + | :<code><nowiki>{{find sources multi/linkinfo|link1|code}}</nowiki></code> | ||
| + | :produces: | ||
| + | :{{find sources multi/linkinfo|link1|code}} | ||
| + | |||
| + | ;Example 3 | ||
| + | |||
| + | :<code><nowiki>{{find sources multi/linkinfo|ddg|code}}</nowiki></code> | ||
| + | :produces: | ||
| + | :{{find sources multi/linkinfo|ddg|code}} | ||
| + | |||
| + | ;Example 4 | ||
| + | |||
| + | :<code><nowiki>{{find sources multi/linkinfo|link1|t_description}}</nowiki></code> | ||
| + | :produces: | ||
| + | :{{find sources multi/linkinfo|link1|t_description}} | ||
| + | |||
| + | ;Example 5 | ||
| + | |||
| + | :<code><nowiki>{{find sources multi/linkinfo|ddg|se_description}}</nowiki></code> | ||
| + | :produces: | ||
| + | :{{find sources multi/linkinfo|ddg|se_description}} | ||
| + | |||
| + | ;Example 6 | ||
| + | |||
| + | :<code><nowiki>{{find sources multi/linkinfo|link1|nonexistentvalue}}</nowiki></code> | ||
| + | :produces: | ||
| + | :{{find sources multi/linkinfo|link1|nonexistentvalue}} | ||
| + | |||
| + | ;Example 7 | ||
| + | |||
| + | :<code><nowiki>{{find sources multi/linkinfo|nonexistentvalue|code}}</nowiki></code> | ||
| + | :produces: | ||
| + | :{{find sources multi/linkinfo|nonexistentvalue|code}} | ||
| + | |||
| + | == Adding new entries == | ||
| + | |||
| + | Adding new entries should be fairly self-explanatory - just keep the format the same as previous entries. However, if you are adding link number 21, please contact [[User:Mr. Stradivarius]] (or if he's not around, someone who knows advanced template coding) as some changes will need to be made to the template's back-end before your new data can be used. | ||
}} | }} | ||
| + | |||
| + | [[Category:Find sources multi subtemplates|{{PAGENAME}}]] | ||
| + | </noinclude> | ||
Latest revision as of 23:07, 9 September 2016
This template stores data about the various search link subtemplates of {{find sources multi}}.
Usage
The template takes two positional parameters.
- The first positional parameter specifies the subtemplate for which data is requested. It may take the value of the subpage name of the link template (e.g.
gnews), a value of linkn (link1,link2, etc.), or its alias ln (l1,l2, etc.). - The second positional parameter specifies what type of data is requested. It can take the following values:
code- The main link code. This is the same as the subpage name of the link template.alias1- An alias for the main link code. The subpage of Template:Find sources multi with this value is a redirect to the link template.alias2- Another alias for the main link code.alias3- A third alias for the main link code.alias4- A fourth alias for the main link code.t_description- A short description of the template.se_description- A short description of the search engine that the template uses.shortcut1- A template shortcut for the link template.shortcut2- A second template shortcut for the link template.shortcut3- A third template shortcut for the link template.notes- Notes about of the link template.
The template will only output data if the following three conditions are all true:
- The first positional parameter has a valid value.
- The second positional parameter has a valid value.
- The data field specified by the first and second positional parameters is not empty.
Otherwise, the template will return a null value.
Examples
- Example 1
{{find sources multi/linkinfo|link1}}- produces:
- Example 2
{{find sources multi/linkinfo|link1|code}}- produces:
- g
- Example 3
{{find sources multi/linkinfo|ddg|code}}- produces:
- ddg
- Example 4
{{find sources multi/linkinfo|link1|t_description}}- produces:
- This template provides a search link to Google to help find sources for articles.
- Example 5
{{find sources multi/linkinfo|ddg|se_description}}- produces:
- DuckDuckGo, a search engine that uses information from crowd-sourced websites (such as Wikipedia) to provide its results.
- Example 6
{{find sources multi/linkinfo|link1|nonexistentvalue}}- produces:
- Example 7
{{find sources multi/linkinfo|nonexistentvalue|code}}- produces:
Adding new entries
Adding new entries should be fairly self-explanatory - just keep the format the same as previous entries. However, if you are adding link number 21, please contact User:Mr. Stradivarius (or if he's not around, someone who knows advanced template coding) as some changes will need to be made to the template's back-end before your new data can be used.
| Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Subpages of this template. |