แม่แบบ:Ref label

[[#endnote_{{{1}}}|[{{{2}}}]]]

Documentation icon คู่มือการใช้งานแม่แบบ

แม่แบบ:Missing information non-contentious

Ref-family templates

The {{ref}} family of templates is used to place labeled references and notes and references into an article, with the labels normally being clickable links for navigating from a ref to a corresponding note and back from the note to the ref. The links and backlinks are identified internally by combining the specified parameters. The templates take a variable number of unnamed parameters identified by their position and, optionally, a named parameter named noid which, if used, should be set by specifying it as "noid=noid".

Very simple example

ArticleWikitext
Text that requires a footnote.{{ref|a|1}}==Notes==:1.{{note|a}}Body of the footnote.

Text that requires a footnote.1

Notes
1.^ Body of the footnote.

The first parameter of {{ref}} is the label that has to be used for the parameter of the corresponding {{note}}. The second parameter is the marker of the resulting link as it will be shown on the page, as a superscript. The easiest choice is to make these two the same, but this is not a requirement.

Labels must be unique

A common error when using {{ref}} is to use it multiple times with the same label. For example:

Text that requires a footnote.{{ref|1|1}}Some other text that requires the same footnote.{{ref|1|1}}==Notes==:1.{{note|1}}Body of the footnote.

This generates two citations with the same label, which is invalid HTML. To fix the problem, use multiple unique IDs; see More complex examples.

Simple examples

{{ref}} and {{note}}

Example:

Article text{{ref|reference_name_A|a}} more text{{ref|reference_name_B|b}} more text {{ref|reference_name_C|c|noid=noid}}.*Bulleted text{{ref|reference_name_B|b|noid=noid}}*Bulleted text{{ref|reference_name_C|c}}.**intervening text**{{note|reference_name_A|a}}Text for note a.*{{note|reference_name_B|b}}Text for note b.*{{note|reference_name_C|c|Text for note c (with extended highlighting).}}

This would produce:

Article texta more textb more text c.

  • Bulleted textb
  • Bulleted textc.
  • intervening text
  • ^a Text for note a.
  • ^b Text for note b.
  • ^c Text for note c (with extended highlighting).

Notice that the navigation back from the note to the ref does not work by clicking the backlink for refs which specify "noid=noid". In practice, if "noid=noid" is specified, it is usually specified for all refs having identical unnamed parameters, and navigation back to the associated ref is done by using the browser's "Back" button.

Also notice that browsers which support highlighting of link-accessed material highlight the active backlink by default, and that the highlighting has been extended to encompass the text for note c by specifying that text as a final template parameter instead of placing it outside of the template.

More complex examples

{{ref label}} pairs with {{note label}}.The {{note label}} template will normally have identical parameters with the ref label with which it is paired, and is normally created by copying the ref, pasting it into the note location, and changing its name to "note label"; this avoids having parameters mismatched because of a typo. Navigation forward uses parameters 1 and 3, navigation backward uses parameters 1 and 2. Parameter 3 is optional, and {{note label}} has an optional fourth parameter.

Example:

Article text{{ref label|reference_name_A|a|1}} more text{{ref label|reference_name_G|g|}} more text {{ref label|reference_name_B|b|2}} more text {{ref label|reference_name_C|c|3}} more text {{ref label|reference name_D|d|4}} more text {{ref label|reference name_E|e|none}} more text {{ref label|reference name_F|f|}} more text {{ref label|reference_name_H|h|8}}.**intervening text**{{note label|reference_name_A|a|1}}Text of note for ref a.*{{note label|reference_name_B|b|2}}Text of note for ref b.*{{note label|reference_name_C|c|3|ABCDE}}Text of note for ref c.*{{note label|reference_name_D|d|4|FGHIJ}}Text of note for ref d.*{{note label|reference_name_E|e|none}}Text of note for ref e.*{{note label|reference_name_F|f}}Text of note for ref f.*{{note label|reference_name_G|g||{{note label|reference_name_H|h|8|Text of note for refs g and h (with extended highlighting).}}}}

This would produce:

Article text[a] more text[g] more text [b] more text [c] more text [d] more text [e] more text [f] more text [h].

  • intervening text
  • 1 Text of note for ref a.
  • 2 Text of note for ref b.
  • 3ABCDE Text of note for ref c.
  • 4FGHIJ Text of note for ref d.
  • ^ Text of note for ref e.
  • f Text of note for ref f.
  • g8Text of note for refs g and h (with extended highlighting).
  1. Note that {{ref label}} produces a superscripted link with square brackets.
  2. The note for ref e has a "^" character as its backlink, because parameter 3 was specified as "none".
  3. The notes for refs f and g do not have a clickable backlink, because parameter 3 was not specified.

Notice that, because the notes for refs g and h above use the same text, note h was made a part of the text passed as a final parameter to note g in order for the extended highlighting to cover both notes.

Table footnotes

One common application for {{ref}} and {{note}} templates is in placing footnotes below tables, as in the following example taken from the Kent#Economy article:

To allow the preview, <ol type="A"> is used. to form the needed list.

YearRegional GVA[A]AgricultureIndustry[B]Services[C]
County of Kent (excluding Medway)
199512,3693793.1%3,88631.4%8,10465.5%
200015,2592591.7%4,60130.2%10,39968.1%
200318,1262871.6%5,05727.9%12,78370.5%
Medway
19951,823213.1%56031.4%1,24368.2%
20002,34881.7%74530.2%1,59567.9%
20032,671101.6%80227.9%1,85969.6%
  1. ^ Components may not sum to totals due to rounding
  2. ^ includes energy and construction
  3. ^ includes financial intermediation services indirectly measured

Alternative referencing style

Using ref/note tags is not the only way to do footnotes. Some people prefer to use Cite.php. Cite.php has many advantages, but is not mandatory. You can use the Ref converter to replace ref/note tags with the newer Cite.php style. If you are interested in the discussion, please see the Footnotes talk page. For details of that system, please see Wikipedia:Footnotes.

Combining Ref family templates with the alternative referencing style

An example combining the use of Ref-family templates with the alternative referencing style might be something like

Yammer yammer yammer.<ref name=smith2000>Smith wrote the definitive book on yammering.{{ref|Smith2000|Smith 2000}}</ref>Yammer yammer yammer.<ref name=smith2000/>...==References==<References/>...==Bibliography==*{{note|Smith2000}}, Smith 2000, "A book about yammering".

which could produce something like:

Yammer yammer yammer.[1]Yammer yammer yammer.[1]
...
==References==
  • 1.0 1.1 Smith wrote the definitive book on yammering.Smith 2000
  • ...
    ==Bibliography==
    • ^ , Smith 2000, "A book about yammering".

    Also see examples and explanation in Wikipedia:Footnote3.

    Third party tool

    A third-party tool to translate articles using the templates described on this page into the Cite.php system is available, see Ref converter.

    See also

    • Wikipedia:Footnotes — Discussion about this reference method
    • Wikipedia:Template messages/Sources of articles
    • Template:Ref — Template for references using this method
    • Template:Ref label — Same as {{Ref}}, but with more features
    • Template:Footnote label — Same as, and redirect to, {{Ref label}}, but ignored by bots that convert {{Ref label}} and {{Ref}} to Cite.php references; for use of these templates for informational footnotes as opposed to reference citations
    • Template:Note — Template for footnotes using this method
    • Template:Note label — Same as Note, but with more features
    • Category:Citation templates — More citation templates, some of which are not part of the Ref/Note Label system
    🔥 Top keywords: หน้าหลักสมเด็จพระนางเจ้าสุทิดา พัชรสุธาพิมลลักษณ พระบรมราชินีองค์การกระจายเสียงและแพร่ภาพสาธารณะแห่งประเทศไทยพิเศษ:ค้นหาอสมทวอลเลย์บอลหญิงเนชันส์ลีก 2024บางกอกคณิกาดวงใจเทวพรหม (ละครโทรทัศน์)เนติพร เสน่ห์สังคมวิทยาศาสตร์พระบาทสมเด็จพระวชิรเกล้าเจ้าอยู่หัวพระราชวัชรธรรมโสภณ (ศิลา สิริจนฺโท)วันวิสาขบูชาวอลเลย์บอลลมเล่นไฟตารางธาตุอันดับโลกเอฟไอวีบีอัลเบิร์ต ไอน์สไตน์หมวดหมู่:จังหวัดของประเทศไทยไลเกอร์รายชื่ออักษรย่อของจังหวัดในประเทศไทยไอแซก นิวตันศาสนาพุทธราชวงศ์จักรีกาลิเลโอ กาลิเลอีประวัติศาสตร์ชาร์เลท วาศิตา แฮเมเนารายชื่อเครื่องดนตรีจังหวัดชัยนาทสังคายนาในศาสนาพุทธประเทศไทยพระบาทสมเด็จพระมหาภูมิพลอดุลยเดชมหาราช บรมนาถบพิตรพระบาทสมเด็จพระจุลจอมเกล้าเจ้าอยู่หัวสโมสรฟุตบอลเรอัลมาดริดนิวแคลิโดเนียวอลเลย์บอลหญิงทีมชาติไทยศาสนาพุทธในประเทศพม่าพระสุนทรโวหาร (ภู่)นริลญา กุลมงคลเพชร