Template:Published: Difference between revisions
Jump to navigation
Jump to search
Documentation
(second parameter) |
(added the possibility of up to six parameters) |
||
Line 1: | Line 1: | ||
<includeonly>'''Published:''' {{#multireplace:  {{{1|}}}  | | <includeonly>'''Published:''' {{#multireplace:  {{{1|}}}  | /(\d\d\d\d)/i={{Cat|$1 works|$1}} }}{{{2|}}}{{#if: {{{3|}}} | ||
/(\d\d\d\d)/i={{Cat|$1 works|$1}} }}{{{ | |{{#multireplace:  {{{3|}}}  | /(\d\d\d\d)/i={{Cat|$1 works|$1}} }}{{{4|}}}}}{{#if: {{{5|}}} | ||
|{{#multireplace:  {{{5|}}}  | /(\d\d\d\d)/i={{Cat|$1 works|$1}} }}{{{6|}}}}}</includeonly><noinclude><!-- | |||
-->{{Doc|1= | -->{{Doc|1= | ||
This template scans the text supplied at the '''Published''' line for any four-digit year, and converts it into a link to "category:YYYY works". The page is simultaneously included in that category. Therefore, works that have a publication date are categorized accordingly. | This template scans the text supplied at the '''Published''' line for any four-digit year, and converts it into a link to "category:YYYY works". The page is simultaneously included in that category. Therefore, works that have a publication date are categorized accordingly. | ||
The template accepts up to six parameters, but only the odd-numbered parameters are scanned for year numbers. Even-numbered parameters are displayed as plain text. Sometimes, there are year numbers in the text that should not be converted into a category link. For these cases, break the text in smaller parts, so that these numbers will fall in a even-numbered parameter. | |||
'''Syntax:''' | '''Syntax:''' | ||
:{{tl|Published|< | :{{tl|Published|<text (scanned)>|<text (displayed as-is)>|<text (scanned)>|<text (displayed as-is)>|<text (scanned)>|<text (displayed as-is)>}} | ||
}} | }} | ||
[[Category:Templates]] | [[Category:Templates]] | ||
</noinclude> | </noinclude> |
Revision as of 15:46, 13 June 2017
This template scans the text supplied at the Published line for any four-digit year, and converts it into a link to "category:YYYY works". The page is simultaneously included in that category. Therefore, works that have a publication date are categorized accordingly.
The template accepts up to six parameters, but only the odd-numbered parameters are scanned for year numbers. Even-numbered parameters are displayed as plain text. Sometimes, there are year numbers in the text that should not be converted into a category link. For these cases, break the text in smaller parts, so that these numbers will fall in a even-numbered parameter.
Syntax:
- {{Published|<text (scanned)>|<text (displayed as-is)>|<text (scanned)>|<text (displayed as-is)>|<text (scanned)>|<text (displayed as-is)>}}