Bản mẫu này sử dụng Lua: |
Bản mẫu này được sử dụng trong thông báo hệ thống, và ở khoảng 13.000 trang. Thay đổi đến nó có thể dẫn đến thay đổi ngay lập tức giao diện người dùng Wikipedia. Để tránh gây lỗi trên quy mô lớn, tất cả thay đổi cần được thử nghiệm ở trang con /sandbox, /testcases của bản mẫu, hoặc ở không gian người dùng của bạn. Các thay đổi đã được thử nghiệm có thể thêm vào bản mẫu bằng một sửa đổi duy nhất. Xin hãy thảo luận các thay đổi tại trang thảo luận trước khi áp dụng sửa đổi. |
The template {{anchor}} inserts one or more invisible HTML fragment identifiers (anchor names) in a page. Those locations can then be linked to using [[#Location|...]]
syntax (note that #Location
here is not a browser instruction like #redirect
—the word "Location" can be any word you wish to associate with any part of an article in which you decide to place the {{anchor}}
template, and can be entirely arbitrary; also, the first letter of the location is usually capitalised to reflect the common capitalisation used in section headers—see for more on this style guideline).
{{anchor|Foo}}
[[#Foo|...]]
from within the same article (let's call this article "Qux"), [[Qux#Foo|...]]
from other articles and from redirects (where the ellipsis after the word "Foo" here means the words chosen to represent that link in the Wikipedia article, which, of course, could be anything).== Foo ==
within a Wikipedia article titled Qux
: == {{anchor|Foo}}
Foo ==
[[Qux#Foo]]
would remain valid even if the section were renamed == {{anchor#Foo}} On foo and its many friends ==
(note that the anchor is placed before the section name; otherwise browsers may hide the section title from view).== {{subst:Anchor|Foo}}
Foo ==
{{anchor|Foo|Bar|baz}}
[[#Foo]]
, [[#Bar]]
and [[#baz]]
.== The placement of the tongue when producing Yish Yash vowel sounds ==
[[Yish Yash (language)#The placement of the tongue when producing Yish Yash vowel sounds|Yish Yash tongue placement]] is particularly interesting.
== Yish Yash vowels and the tongue ==
== {{anchor|Tongue}} The placement of the tongue when producing Yish Yash vowel sounds ==
== {{anchor|Tongue}} Yish Yash vowel/ tongue interaction ==
and the text of the article on Proto-Indo-European vowels had been changed by you to something like this:[[Yish Yash (language)#Tongue|Yish Yash tongue placement]] is particularly interesting.
Ký tự | Mã | Bản mẫu | Định nghĩa |
---|---|---|---|
" | " "
|
— | (double) quotation mark |
# | #
|
— | hash |
| | |
|
{{!}} | pipe |
= | =
|
{{=}} | equals |
<sup>
and <sub>
(superscript and subscript) cannot be used. Most other characters, including white space and punctuation, are not a problem.#location
links go to the first anchor with that name. Duplicate anchors result in invalid HTML; you can check for duplicate anchors by running the page through the W3C Markup Validation Service./* {{anchor|Issues}}Limitations */ New issue
". Also, when the section is saved, browsers may not return to the section. Consider substituting the template, resulting in <span id="..."></span>
, when in a section title.Anchors may be used within tables, subject to certain restrictions. The {{anchor}}
template may be used in the caption and cells of a table, but not those portions of a table that are outside the caption and cells. It is used on the table's caption thus:|+ {{anchor|FooX}} A table caption
and the following forms of cell are valid:!{{anchor|Foo1}} A header cell !style="background:white;" |{{anchor|Foo2}} A header cell with styling |{{anchor|Foo3}} A data cell |rowspan=2 |{{anchor|Foo4}} A data cell spanning two rows
You need to ensure that the {{anchor}}
is not in that portion of the markup intended for the classes, styles etc. Thus, {{anchor}}
cannot be placed anywhere on lines that begin with {|
(start of table) or |-
(new row), and the following forms of cell are not valid:!{{anchor|Foo1}} |A header cell !style="background:white;" {{anchor|Foo2}} |A header cell with styling |{{anchor|Foo3}} |A data cell |rowspan=2 {{anchor|Foo4}} |A data cell spanning two rows
If it is necessary for an anchor to be in any of these positions, a different technique is used—the id=
attribute. This is placed in that portion of the markup where the classes, styles etc. may be used, as follows:{| id=FooX class=wikitable |- id=FooY !id=Foo1 |A header cell !style="background:white;" id=Foo2 |A header cell with styling |id=Foo3 |A data cell |rowspan=2 id=Foo4 |A data cell spanning two rows
The id=
attribute may appear before, between or after any other attributes that may be present, but only one id=
attribute may be used in each of these areas.
Dữ liệu bản mẫu cho Anchor
The template {{anchor}} inserts one or more HTML anchors in a page. Those locations can then be linked to using [[#location|...]] syntax. The parameters labels shown here (e.g., 'First anchor', '1', and the rest) are provided for convenience; no parameter label is required in the template itself, so you may create an anchor within an article by typing {{anchor|go here}} or {{anchor|this is it}} rather than {{anchor|First anchor=go here}} or {{anchor|1=this is it}} (though both formats will work correctly). You may not use {{anchor}} all by itself, however, as this is like dropping a ship's anchor without tying a rope to it: it holds nothing in place, can't be found or used, and messes up the sea floor with garbage!
Tham số | Miêu tả | Kiểu | Trạng thái | |
---|---|---|---|---|
First anchor | 1 | First anchor value; Only the first anchor is required. | Chuỗi dài | bắt buộc |
Second anchor | 2 | Second anchor. | Chuỗi dài | tùy chọn |
Third anchor | 3 | Third anchor. | Chuỗi dài | tùy chọn |
4th, 5th, ... anchor | 4 | For additional anchors, just add additional anchors (the template isn't limited to three) | Chuỗi dài | tùy chọn |