Difference between revisions of "Template:Find sources multi/linkinfo"
Jump to navigation
Jump to search
Template documentation
imported>Mr. Stradivarius (Change Google description) |
imported>Mr. Stradivarius (Add documentation) |
||
| Line 183: | Line 183: | ||
| notes = | | 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.). If this parameter is not specified, or the value is not valid, the template outputs a null value. | ||
| + | * 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. | ||
| + | |||
| + | If the first positional parameter has a valid value, but the second positional parameter is absent or has an invalid value, the template will output the main link code for the link template specified by the first positional parameter. If both the first and second positional parameters have valid values, but no data is found, the template will output 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}} | ||
}} | }} | ||
Revision as of 07:50, 14 March 2013
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.). If this parameter is not specified, or the value is not valid, the template outputs a null value. - 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.
If the first positional parameter has a valid value, but the second positional parameter is absent or has an invalid value, the template will output the main link code for the link template specified by the first positional parameter. If both the first and second positional parameters have valid values, but no data is found, the template will output a null value.
Examples
- Example 1
{{find sources multi/linkinfo|link1}}- produces:
- g
- 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:
- g
- Example 7
{{find sources multi/linkinfo|nonexistentvalue|code}}- produces:
| Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Subpages of this template. |