Difference between revisions 22403306 and 26172111 on viwiki

{{Trang con tài liệu}}

===Cách sử dụng===

===Xem thêm===__NOTOC__
===Mục đích===
This template is intended to be used in year-based categories '''where the year is the first thing in the category name''' (for example, [[:Thể loại:Âm nhạc Canada năm 2008|2008 in Canadian music]] or [[:Thể loại:Thảm họa 1979|1979 disasters]]).  It creates a "timeline" style table of links to categories for adjacent years before or after it in the same decade (see example below).

===Cú pháp===
<pre>
{{Year by category
| m = 
| c = 
| d = 
| y = 
| cat = 
| in = 
| parent = 
| subcat = 
| sortkey = 
}}
</pre>

===Các tham số===
The first 5 parameters split the name of the category page receiving the template into separate pieces. They are used to form the timeline links.
* '''m =''' <var>ký số thế đại</var>
* '''c =''' <var>ký số thế kỷ</var>
* '''d =''' <var>ký số thập niên</var>
* '''y =''' <var>ký số năm</var>
*: The single-digit values of these 4 parameters, taken together ("'''mcdy'''"), form the four-digit year. If the year is before 1000 (and thus only 3 digits long) or even earlier, parameters can be omitted, as necessary.
* '''cat =''' <var>category name suffix</var>
*: The portion of the category name after the year, including the word "in" if present.
<br />
The next parameter can be used to link to a "main article" for the category.
* '''in =''' <var>see also article name suffix</var>
*: ''Optional:''  Adds a "see also" link to a closely related "year-in" article. This suffix should ''not'' contain the year or the word "in", which is provided by the template itself.
<br />
The rest of the parameters are used to categorize the page containing the template.
* '''parent =''' <var>parent category name</var>
*: ''Optional:'' Full name (not including "Category:" prefix) of the category into which this category ''and similar categories for other years'' will all be placed (typically, but not always, named something like "<var>topic</var> by year"). Note that a [[WP:SORTKEY|sortkey]] is ''not used'', so the sorting will be by year.
* '''subcat =''' <var>different category name</var>
*: ''Optional:'' The full name (not including the "Category:" prefix) of another appropriate parent category, typically ''for the same year''. If omitted, the current category will be placed in the category for the year itself, using the value of the "cat" parameter as the [[WP:SORTKEY|sortkey]] (note that this will not be acceptable if the value of "cat" begins with the word "in").
* '''sortkey =''' <var>category sortkey text</var>
*: The [[WP:SORTKEY|sortkey]] used on the category link created by the previous parameter. If "subcat" is used but "sortkey" is not specified, a blank sortkey will be used.
Note that both the "parent" and "subcat" parameters are referring to ''parent categories'' of the category page the template is being placed on.

===Các ví dụ===
====Sử dụng tất cả các tham số====
Khi được đặt trên trang [[:Thể loại:Âm nhạc Canada năm 2008]]:
<pre>
{{Year by category
| m = 2
| c = 0
| d = 0
| y = 8
| cat = Âm nhạc Canada năm
| in = Âm nhạc Canada
| parent = Âm nhạc Canada theo năm
| subcat = Canada năm 2008
| sortkey = Âm nhạc
}}
</pre>
* hiển thị sau "dòng thời gian" và "xem thêm" liên kết bài viết:
<blockquote>
{{Year by category
| m = 2
| c = 0
| d = 0
| y = 8
| cat = Âm nhạc Canada năm
| in = Âm nhạc Canada
| parent = Âm nhạc Canada theo năm
| subcat = Canada năm 2008
| sortkey = Âm nhạc
}}
</blockquote>
* đặt trang vào [[:Thể loại:Âm nhạc Canada theo năm]] (sắp xếp theo năm) và [[:Thể loại:Canada năm 2008]] (sử dụng sortkey "Âm nhạc", mà là phù hợp vì tất cả mọi thứ trong thể loại này đã gắn liền với năm 2008 và Canada)

====Sử dụng một số tham số====
Khi được đặt trên trang [[:Thể loại:Thảm họa 1912]]:
<pre>
{{Year by category
| m = 1
| c = 9
| d = 1
| y = 2
| cat = thảm họa
| parent = Thảm họa thế kỷ 20
}}</pre>
* hiển thị sau "dòng thời gian" (lưu ý năm qua không phải là liên kết, vì nó sẽ là một tham khảo đến cùng thể loại bản mẫu là trên):
<blockquote>
{{Year by category
| m = 1
| c = 9
| d = 1
| y = 2
| cat = thảm họa
| parent = Thảm họa thế kỷ 20
}}
</blockquote>
* đặt trang vào [[:Thể loại:Thảm họa thế kỷ 20]] (sắp xếp theo năm) và (kể từ "subcat" đã không được chỉ định) [[:Thể loại:1979]] (sử dụng sortkey "thảm họa")

===Bản mẫu con===
* {{tl|Year by category/core}}

<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
[[Thể loại:Tiêu bản thời gian]]
[[Thể loại:Bản mẫu tác phẩm theo năm]]
}}</includeonly>