Template:Citeref/doc
| This is a documentation subpage for Template:Citeref. It contains usage information, categories and other content that is not part of the original template page. |
| This template is safe for use in citation templates that produce COinS metadata; see Wikipedia:COinS. If HTML or other markup is added, then the template must be reevaluated. |
Contents
Description
This template can be used to create wiki links to citations defined through CS1/CS2 citation templates. It is a wrapper around {{harvid}} to make it easier to create links with small superscript labels (like [n]) similar to those created by Mediawiki's <ref>...</ref> style.
Usage
A typical use is inside of |quote=, if the quotation refers to other works defined as citations in the same article.
The template supports 1 to 4 author name parameters (as per {{harvid}} followed by 1 date parameter (also as per {{harvid}} to compose the appendage to CITEREF in order to match the internal anchor created by the citation template this link should point to. The last parameter is the label text that should be displayed as link text, f.e. "a", "b", "c", etc. While this does not affect the functionality make sure that these labels do not clash with other labels used for citations or notes in the same article in order to avoid confusion for users.
If only one parameter is given, the label text will be the same.
The optional named parameter |style=plain can be used to switch the display style from the default superscript labels to plain text.
In order to avoid dangling links, please check the links by clicking on them after creation and when changing the author/editor names or dates in the corresponding citations.
Examples
Example reference definitions:[1][2]
<ref name="Example_Ref_1">{{cite book |title=Title |author=Author |date=2019 |quote=Example text referring to another citation{{citeref|Author|2020|b}}.}}</ref><ref name="Example_Ref_2">{{cite book |title=Title |author=Author |date=2020 |quote=Example text referring to {{citeref|Author|2019|another citation|style=plain}}.}}</ref>
{{citeref|Author|2019|a}}:
- Example text[a]
{{citeref|Author|2019|text|style=plain}}:
- Example text
See also
- {{harvid}}
- {{refn}} (a different method to create nested links working on <ref></ref> markup level rather than on citation template anchor level)
- Wikipedia:Citation templates
References
- ↑ Author (2019). Title.
Example text referring to another citation[b].
- ↑ Author (2020). Title.
Example text referring to another citation.