Template:Lengthlink

From Wikipedia, the free encyclopedia


The template {{lengthlink | title | class | length}} is used on WikiProject pages in order to enhance links to articles with an indication of the article's length. The template accepts three parameters, which are positional (not named parameters). The parameters are:

  • title - the title of the page to link to
  • class - an integer number between 0 and 10 (inclusive), used for the little bar graph shown next to the link
  • length - the length of the page, number of characters. This is displayed in the link title which most browsers show on mouse-over.

A useful value for the class can be computed using the formula int(log($length/50.0)/log(2.0)), which gives the following intervals:

       Class      Length
 image:0von10ggr.png   0        0..99    characters
 image:1von10ggr.png   1      100..199   characters
 image:2von10ggr.png   2      200..399   characters
 image:3von10ggr.png   3      400..799   characters
 image:4von10ggr.png   4      800..1599  characters
 image:5von10rgg.png   5     1600..3199  characters
 image:6von10ggr.png   6     3200..6399  characters
 image:7von10ggr.png   7     6400..12799 characters
 image:8von10ggr.png   8    12800..25599 characters
 image:9von10ggr.png   9    25600..51199 characters
 image:10von10rgg.png  10    51200 characters or more

Example: The page Dan Andersson is 4962 characters long and falls in size class 6.
The template is used thus: {{ lengthlink | Dan Andersson | 6 | 4962 }}
This will be displayed like this: the article about Dan Andersson is 4962 characters longDan Andersson
If you mouse-over the bar graph, a text is shown that explains the exact length.

BUGS: Length is not the same as quality. But since we don't know how to compute the quality of an article, the length can be a useful indicator in some situations. This template does not allow alternative link text (as in [[link | text]].

Languages