Khác biệt giữa bản sửa đổi của “Bản mẫu:Hộp thông tin/doc”
Nội dung được xóa Nội dung được thêm vào
Không có tóm lược sửa đổi |
|||
Dòng 2:
{{chú ý|'''Bản mẫu này {{đỏ|không được [[Wikipedia:Thay thế bản mẫu|thay thế]]}}.}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE. -->
{{
<includeonly>{{#ifeq: {{#titleparts: {{PAGENAME}} | 1 | 2 }} | old | <!-- null --> | {{lua|Module:Infobox}} }}</includeonly>
Bản mẫu này được sử dùng để viết các bản mẫu khác. Nó không được khuyến khích dùng trực tiếp vào bài viết, tuy nhiên vẫn có thể dùng được trong trường hợp cần thiết. Xem [[:en:Help:Infobox]] về hướng dẫn viết hộp thông tin và cách thức viết chúng. Tham khảo [[Wikipedia:Cẩm nang biên soạn]] và [[:Thể loại:Bản mẫu hộp thông tin]] để xem các bản mẫu đã viết.
This template is intended as a meta-template: a template used for constructing other templates. It is not meant for use directly in an article, but can be used on a one-off basis if required. See [[Help:Infobox]] for an introduction to infoboxes and information on how to design them. See [[:Category:Infobox templates]] for specific infobox templates.
Hàng 28 ⟶ 30:
Examples:
{{Hộp thông tin
| name = Infobox/doc
| title = Text in caption over infobox
Hàng 35 ⟶ 37:
}}
<pre style="overflow:auto">
{{Hộp thông tin
| name = {{subst:PAGENAME}}
| title = Text in caption over infobox
Hàng 43 ⟶ 45:
</pre>{{clear}}
{{Hộp thông tin
| name = Infobox/doc
| above = Text in uppermost cell of infobox
Hàng 51 ⟶ 53:
}}
<pre style="overflow:auto">
{{Hộp thông tin
| name = {{subst:PAGENAME}}
| above = Text in uppermost cell of infobox
Hàng 69 ⟶ 71:
; data(n) : Text to display as data in row n. Header and data parameters should not be spaced more than 50 apart.
Note: for any given value for (n), not all combinations of parameters are permitted. The presence of a {{
* {{
* {{
* {{
See the rendering of header4, label4, and data4 in the [[#Examples|Examples]] section below.
Hàng 116 ⟶ 118:
===== Hiding headers when all data fields are hidden =====
You can also make headers optional in a similar way. Consider this example:
{{Hộp thông tin
| title = Example of an undesirable header
| header1 = Undesirable header
Hàng 126 ⟶ 128:
}}
<pre style="overflow:auto">
{{Hộp thông tin
| title = Example of an undesirable header
| header1 = Undesirable header
Hàng 139 ⟶ 141:
If you want the first header to appear only if one or more of the data fields that fall under it are filled, one could use the following pattern as an example of how to do it:
{{Hộp thông tin
| title = Example of an optional header
| header1 = {{ #if: {{{item1|}}}{{{item2|}}}{{{item3|}}} | Optional header }}
Hàng 149 ⟶ 151:
}}
<pre style="overflow:auto">
{{Hộp thông tin
| title = Example of an optional header
| header1 = {{ #if: {{{item1|}}}{{{item2|}}}{{{item3|}}} | Optional header }}
Hàng 172 ⟶ 174:
Titles of articles with infoboxes may be made italic, in line with [[WP:ITALICTITLE]], by passing the <code>italic title</code> parameter.
* Turn on italic titles by passing {{
* Turn off by default (notably because only Latin script may be safely rendered in this style and italic may be needed to distinguish foreign language from local English language only in that script, but would be difficult to read for other scripts) but allow some instances to be made italic by passing {{
* Do not make any titles italic by not passing the parameter at all.
Hàng 228 ⟶ 230:
Notice how the row doesn't appear in the displayed infobox when a '''label''' is defined without an accompanying '''data''' cell, and how all of them are displayed when a '''header''' is defined on the same row as a '''data''' cell. Also notice that '''subheaders''' are not bold by default like the '''headers''' used to split the main data section, because this role is meant to be for the '''above''' cell :
{{Hộp thông tin
|name = Infobox/doc
|bodystyle =
Hàng 269 ⟶ 271:
}}
<pre style="overflow:auto">
{{Hộp thông tin
|name = {{subst:PAGENAME}}
|bodystyle =
Hàng 313 ⟶ 315:
For this example, the '''bodystyle''' and '''labelstyle''' parameters are used to adjust the infobox width and define a default width for the column of labels:
{{Hộp thông tin
|name = Infobox/doc
|bodystyle = width:20em
Hàng 344 ⟶ 346:
}}
<pre style="overflow: auto">
{{Hộp thông tin
|name = {{subst:PAGENAME}}
|bodystyle = width:20em
Hàng 377 ⟶ 379:
=== Embedding ===
One infobox template can be embedded into another using the {{
{{Hộp thông tin
| title = Top level title
| data1 = {{
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| data2 = {{
|title = Second subsection
| label1= Label 2.1
Hàng 395 ⟶ 397:
}}
<pre style="overflow:auto">
{{Hộp thông tin
| title = Top level title
| data1 = {{
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| data2 = {{
|title = Second subsection
| label1= Label 2.1
Hàng 414 ⟶ 416:
Note, in the examples above, the child infobox is placed in a <code>data</code> field, not a <code>header</code> field. Notice that the section subheadings are not in bold font if bolding is not explicitly specified. To obtain bold section headings, place the child infobox in a '''header''' field (but not in a '''label''' field because it would not be displayed!), either using
{{Hộp thông tin
| title = Top level title
| header1 = {{
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| header2 = {{
| title = Second subsection
| label1= Label 2.1
Hàng 430 ⟶ 432:
}}
<pre style="overflow:auto">
{{Hộp thông tin
| title = Top level title
| header1 = {{
| title = First subsection
| label1= Label 1.1
| data1 = Data 1.1
}}
| header2 = {{
| title = Second subsection
| label1= Label 2.1
Hàng 449 ⟶ 451:
or,
{{Hộp thông tin
| title = Top level title
| header1 = First subsection
{{
| label1 = Label 1.1
| data1 = Data 1.1
}}
| header2 = Second subsection
{{
| label1 = Label 2.1
| data1 = Data 2.1
Hàng 465 ⟶ 467:
}}
<pre style="overflow:auto">
{{Hộp thông tin
| title = Top level title
| header1 = First subsection
{{
| label1 = Label 1.1
| data1 = Data 1.1
}}
| header2 = Second subsection
{{
| label1 = Label 2.1
| data1 = Data 2.1
Hàng 482 ⟶ 484:
</pre>{{clear}}
Note that omitting the {{
=== Subboxes ===
An alternative method for embedding is to use {{
{{Hộp thông tin
| headerstyle = background-color:#eee;
| labelstyle = background-color:#eee;
| header1 = Main 1
| header2 = Main 2
| data3 = {{
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
Hàng 499 ⟶ 501:
| label3 = Label 3-3 | data3 = Data 3-3
}}
| data4 = {{
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
Hàng 507 ⟶ 509:
}}
<pre style="overflow:auto">
{{Hộp thông tin
| headerstyle = background-color:#eee;
| labelstyle = background-color:#eee;
| header1 = Main 1
| header2 = Main 2
| data3 = {{
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
Hàng 519 ⟶ 521:
| label3 = Label 3-3 | data3 = Data 3-3
}}
| data4 = {{
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
Hàng 535 ⟶ 537:
| heading1 = Heading 1
| heading2 = Heading 2
| content3 = {{
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
Hàng 542 ⟶ 544:
| label3 = Label 3-3 | data3 = Data 3-3
}}
| content4 = {{
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
Hàng 554 ⟶ 556:
| heading1 = Heading 1
| heading2 = Heading 2
| content3 = {{
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
Hàng 561 ⟶ 563:
| label3 = Label 3-3 | data3 = Data 3-3
}}
| content4 = {{
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
Hàng 575 ⟶ 577:
<pre style="overflow:auto">
{{Hộp thông tin
| name = {{subst:PAGENAME}}
| child = {{{child|}}}
|