Difference between revisions 68766120 and 68766128 on viwiki

{{Trang con tài liệu}}
__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 categoryNăm theo thể loại
| m = 
| c = 
| d = 
| y = 
| cat = 
| in = 
| parent = 
(contracted; show full)
*: 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 categoryNăm theo thể loại
| 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 categoryNăm theo thể loại
| 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 categoryNăm theo thể loại
| 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 categoryNăm theo thể loại
| 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 categoryNăm theo thể loại/core}}

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