Last modified: 2008-08-29 06:34:06 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T15483, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 13483 - {{PAGELENGTH}} magic word
{{PAGELENGTH}} magic word
Status: RESOLVED WORKSFORME
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-03-23 00:53 UTC by naught101
Modified: 2008-08-29 06:34 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description naught101 2008-03-23 00:53:19 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.
Comment 1 X! 2008-03-23 03:29:55 UTC
Working on now, but it's only Article namespace.
Comment 2 naught101 2008-08-28 05:35:42 UTC
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.
Comment 3 Roan Kattouw 2008-08-28 08:36:29 UTC
(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).
Comment 4 Roan Kattouw 2008-08-28 09:09:30 UTC
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.
Comment 5 Roan Kattouw 2008-08-28 09:15:03 UTC
(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 :
Comment 6 naught101 2008-08-29 06:30:50 UTC
Roan, what version is {{PAGESIZE}} available in? I don't have it on my wiki

cheers
ned 
Comment 7 naught101 2008-08-29 06:34:06 UTC
Never mind. I found it at http://www.mediawiki.org/wiki/Help:Magic_words#Statistics

guess it's time to upgrade again :)

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links