Difference between revisions of "Template:ShortURL"

From FollowTheScore
Jump to: navigation, search
Line 30: Line 30:
  
 
<pre>{{ShortURL|url=http://en.wikipedia.org/wiki/F%C3%A9d%C3%A9ration_Internationale_de_Gymnastique|count=10|forcecount=yes}}</pre>
 
<pre>{{ShortURL|url=http://en.wikipedia.org/wiki/F%C3%A9d%C3%A9ration_Internationale_de_Gymnastique|count=10|forcecount=yes}}</pre>
Result: {{ShortURL|url=http://en.wikipedia.org/wiki/F%C3%A9d%C3%A9ration_Internationale_de_Gymnastique|count=10}}
+
Result: {{ShortURL|url=http://en.wikipedia.org/wiki/F%C3%A9d%C3%A9ration_Internationale_de_Gymnastique|count=15}}

Revision as of 20:29, 23 July 2009

This is not finished yet.

The template

...

Usage

This shortens URLS.
Note: Requires Extension:StringFunctions

Usage

{{ShortURL
|url    =
|count  =
|suffix =
|tolerance   =
|forcecount  =(yes)
}}
  • count: optional / default: 25
The number of displayed characters (white space / blanks are counted).
It uses a tolerance of 5. So if you define count=10 the string will not be shortened if it is between 1 and 15 characters long.
  • suffix: optional / default: "…" (not ...)
Adds an suffix at the end of the shortened string.
  • tolerance: optional / default: 5
Override the default tolerance.
  • forcecount: optional / default: no
forcecount=yes overrides the (default) tolerance and forces a strict count.

Examples

{{ShortURL|url=http://en.wikipedia.org/wiki/Main_Page}}

Result: delete me

{{ShortURL|url=http://en.wikipedia.org/wiki/F%C3%A9d%C3%A9ration_Internationale_de_Gymnastique|count=10|forcecount=yes}}

Result: delete me