Template:Sfnlink/doc

Creates a one-directional wikilink to the first matching citation template of the article. Unlike sfn, it does not create a short citation; it creates only the outgoing link. This could be used to link two references; for example, to link a translated work to the original work in a list of references that contains both of them. It may also be used as a workaround for certain false positive errors such as "missing key" errors when short citations are embedded within list-defined references, or as linkage from a Talk page discussion to a citation in an article.

Usage
– typical usage.

Quick start
If you want to create a one-way link to a full citation in the Bibliography section of your article which already has a working sfn that links to it, just copy the sfn invocation out of the wikicode, change 'sfn' to 'sfnlink', and it should just work. You can add param text if you want to change the display text underlying the link, and if you are linking from the Talk page, add * to the invocation to link to the article (mainspace) citation.

Parameters
Positional parameters 1–5 are the same as in template sfn: typically, one to four author surnames, and a YYYY year. The first author surname (positional param 1) is required; other authors and the year are required if available in the full citation. If present, year must be the last positional parameter. All parameters except the first are optional.

Basic – these are the same as the parameters of sfn:
 * &lt;last1> – surname of first author or corporate author (required)
 * &lt;last2> – &lt;last4> – positional parameters; surnames of next three authors
 * &lt;year> – four-digit year; may have a lowercase disambiguation letter like 2012a
 * p – specific page referenced in the source (alias: page )
 * pp – comma-separated list of individual pages and / or range(s) of pages referenced in the source (alias: pages )
 * loc – in-source location: information such as a section or figure number; usually used when p and pp are inappropriate, but may be used to supplement them.

Supplementary – parameters for configuring the link, how it's displayed, and extending its range:
 * yes – removes parentheses ('nb' = 'no brackets') from around the year. Default: year is displayed in parens.
 * text – display text for the link. (default: &lt;last1> – &lt;last4> in comma series, plus the parenthesized year) (interacts with 'nb'; see param notes)
 * article – article or page title; may be used to link to a short footnote's full citation destination on another article or page. Use an asterisk (i.e., *) to target the article or subjectpage with which the Talk page is associated. (restricted; see param notes)
 * rev – revision id ("oldid"); may be used to link to a full citation in an old revision of an article (restricted; overrides 'article'; see param notes)
 * lang – the language code of the foreign language Wikipedia where the citation is located; requires 'rev' or 'article'; (restricted; see param notes)

Parameter notes

By design, positional parameters 1 – 5 and the page params, the page params, and param 'loc' are the same as parameters in template Sfn. In most cases where sfn generates a false missing key error, it can be resolved simply by changing  to   and leaving everything else alone.

You can specify any value for nb to remove parentheses from around the year, such as yes, 1 etc. (Even no does it.)  Param text overrides any value for nb; if you want parens while using 'text', just supply them in the param value. For an alternative way to accomplish this, see template Sfnlinknb.

Optional parameter article is not recommended for mainspace, but it may be useful in Talk page discussions to link to citations in related discussions on other pages, or to link directly to a mainspace article citation without having to resolve it with a local references section on a Talk page. Use * as a shortcut to indicate that your target citation is on the page associated with the Talk page you are on (i.e., at ).

Optional parameter rev is not recommended for use in mainspace. If present, the revision id is sufficient to uniquely identify a particular revision of an article, so param article is superfluous in that case. You may, if you wish, use rev and article together just for the documentary value of having the article named in the wikicode for the benefit of other editors, however when both are present, the value of article is ignored and only the rev is used.

Param lang should not be used in mainspace. In tandem with param article or rev, it provides linkage to citations on foreign Wikipedias, and is designed primarily for use on Talk pages where another Wikipedia has a citation of interest to discuss here. Almost all foreign Wikipedias support the use of short citations with linkage to full citations, however, Wikipedias do not, so codes   may not be used as a value for lang and will generate an error. You can use lang and rev together to link to a citation in an old version of a foreign Wikipedia article (use of article is optional in this case; if used, it is of documentary value only and does not affect the result).

Examples
{{markup
 * The sun is a star.{{sfn|Smith|2015|pp=251–254}} It is hot.{{sfn|Dupont|2012|p=19}}

Some discussion
The reference that is now listed there is only accessible with a subscription... User:Example1

The reference that is now listed there is only accessible with a subscription... User:Example1 }}

Note: if discussion "Some discussion" is taking place at the associated Talk page (i.e., 'Talk:Bede' in this case), then the following code using the asterisk shortcut is equivalent to the above:.

{{markup
 * The sun is a star.{{sfn|Smith|1993|p=25}}{{efn|name="disc"}} It is hot.{{efn|name="how-hot"}}

When to use
This template may be useful for various situations in which you need a unidirectional link to an existing citation. Here are some possible use cases: An alternative to this template is citeref; when used from mainspace, they are functionally equivalent. From talk space, an alternative is sfnt.
 * to discuss an existing article citation from the Talk page of the article, and link to it;
 * to add a unidirectional link to a citation within the article itself, where harvnb isn't apt, such as when you need to change the link text; for example:
 * to link a citation of a translated work, to an another citation representing the original language work'
 * to link one author crediting another: when the author of source A refers to source B in their work, and you have citations to both A and B in your article, you can link words in the quote param of A directly to your B citation.
 * to avoid certain bugs, such as false positive errors when an sfn template is embedded in a list-defined reference.
 * to discuss an existing article citation located in a different article, or in a page on another Wikipedia.

When not to use
Don't use this template:
 * to create a short citation; use sfn instead;
 * to create a link from a chapter of a book to the full cite book citation; use citec / harvc instead;
 * to create a unidirectional link from an article to a citation within the article, if one of the templates implemented by Module:Footnotes will do what you need, such as harvnb.