# வார்ப்புரு:Year by category/doc


__NOTOC__  
### Purpose
This template is intended to be used in year-based categories **where the year is the first thing in the category name** (for example, 2008 in Canadian music or 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).  

### Syntax
<pre>  

</pre>  

### Parameters
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>millennium digit</var>
- **c =** <var>century digit</var>
- **d =** <var>decade digit</var>
- **y =** <var>year digit</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.

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.

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 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 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 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.  

### Example using all parameters
When placed on the page :Category:2008 in Canadian music:  
<pre>  
</pre>  
- displays the following "timeline" and "see also" article link:
<blockquote>  

</blockquote>  
- places the page into :Category:Years in Canadian music (sorted by year) and :Category:2008 in Canada (using the sortkey "Music", which is appropriate since everything in the latter category already pertains to 2008 and Canada)

### உதாரணம்
id="toc" ="1" cellpadding=4  
|| [[:  
|}  
</blockquote>  
- places the page into [[:Category:20th-century disasters (sorted by year) and (since "subcat" wasn't specified) :[[:

<includeonly>  

[[ar:قالب:السنة حسب التصنيف  
bn:টেমপ্লেট:Year by category  
en:Template:Year by category  
es:Plantilla:Países por año  
ja:Template:Year by category  
tr:Şablon:Yıla göre kategori  
uk:Шаблон:Рік за категорією  
ur:سانچہ:سال بلحاظ زمرہ  
zh:Template:依分類劃分的年份  

</includeonly>