Template talk:User age
I have removed the "XX year old Wikipedians" category from the template because it was creating large number of red category links.
First there's the fact that most of the expected categories simply do not exist. Category:23 year old wikipedians, for example. If this is going to work, then all of those categories should be built out.
And then there are the large number of people not satisfied to simply enter a numeric year. There are fractions, smileys, and other things that people have added to the field. All of these create red category links at the bottom of the user pages. - TexasAndroid 13:59, 9 May 2006 (UTC)
- Categories were created for ages 10–19, but I don't know if any others were. I was going to do more but I never got around to it. Sweetie Petie 14:31, 9 May 2006 (UTC)
Automatic updating
For the users who don't want to update their age every year, it is possible to use the age template for this. The syntax would be:
{{User age|{{age|format=raw|"year of birth"|"month of birth"|"day of birth"}}}}
For example:
{{User age|{{age|format=raw|1984|06|21}}}}
returns:
| 42 | This user is 42 years old. |
Cristan (talk) 08:40, 19 December 2007 (UTC)
Converting to use module broke this usage
For example:
{{User age/sandbox|format=raw|{{age|1984|06|21}}}}
returns:
| 42 | This user is 42 years old. |
wbm1058 (talk) 02:13, 31 March 2022 (UTC)
- @Wbm1058: In general, when a template does something odd, it is useful to see exactly what it displays in Special:ExpandTemplates. Trying {{age}} with one date would show that the output includes a hidden span. If only the number is wanted,
format=rawshould be used, for example:{{User age|{{age|format=raw|21 June 1984}}}}→
| 42 | This user is 42 years old. |
- The reason for the span is that a lot of infoboxes displayed nonsense because people used {{age}} with only one date. The result looked good at the time because the current date gave a sensible result. However, as the years pass, the infobox displays an increasingly wrong age (for example, a deceased person should have two dates in {{age}} and entering only one gives an incorrect result). The issue is documented at Template:Age. Johnuniq (talk) 03:52, 31 March 2022 (UTC)
- OK, so the addition of the new
{{{format}}}was a breaking change. I've fixed the broken usage here to remove this page from Category:ParserFunction errors. – wbm1058 (talk) 11:50, 31 March 2022 (UTC)
- OK, so the addition of the new
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.