Last modified: 2008-08-29 06:34:06 UTC
Would it be possible to implement a {{PAGELENGTH}} variable/template, similar to the {{PAGENAME}}? This would be very useful for creating template-included categories sorted by length (i.e. [[category:name|{{PAGELENGTH}}]], and perhaps some other uses.
Working on now, but it's only Article namespace.
Thanks Soxred93. I specifically wanted this variable so that I could add all my stubs to a category like [[Category:short pages|{{PAGELENGTH}}]]. This would only work if the {{PAGELENGTH}} variable could include leading zeros, so perhaps an additional request would be to include a variable for how long the resultant string would be, ie: {{PAGELENGTH|5}} would return 00245 for a 245 character page, and 15693 for a page that long.
(In reply to comment #2) > This would only work if > the {{PAGELENGTH}} variable could include leading zeros, so perhaps an > additional request would be to include a variable for how long the resultant > string would be, ie: > {{PAGELENGTH|5}} would return 00245 for a 245 character page, and 15693 for a > page that long. > {{padleft:{{PAGELENGTH}}|5|0}} does what you want (adding leading zeros until the number has 5 digits).
Hmm, apparently we already have {{PAGESIZE|foo}}, which will give you the size of [[Foo]]. Unfortunately, {{PAGESIZE|{{FULLPAGENAME}}}} doesn't really work well, as you'll get the size of the previous revision of the page, until you purge the page, after which the number should be correct. I'm talking to Tim about how to fix that.
(In reply to comment #4) > Hmm, apparently we already have {{PAGESIZE|foo}}, which will give you the size > of [[Foo]]. Unfortunately, {{PAGESIZE|{{FULLPAGENAME}}}} That should of course be {{PAGESIZE:{{FULLPAGENAME}}}}, which a :
Roan, what version is {{PAGESIZE}} available in? I don't have it on my wiki cheers ned
Never mind. I found it at http://www.mediawiki.org/wiki/Help:Magic_words#Statistics guess it's time to upgrade again :)