Template:Short

From FollowTheScore
Revision as of 19:02, 23 July 2009 by Subfader (talk | contribs)
Jump to: navigation, search

The template

{{#ifexpr:{{#len: {{{string|}}} }} > {{#expr:{{{count|25}}}+5}}|{{#sub:{{{string|}}}|0|{{{count|25}}}}}{{{suffix|}}}|{{{string|}}}}}

Usage

This shortens strings. This can be used to shorten URLs or included text.

Usage
{{Short
|string =
|count  =
|suffix =
}}
  • count: optional / default: 25
  • suffix: optional / no default for because of wiki markup for URLs
Example URL
[http://en.wikipedia.org/wiki/Mediawiki#Extensions {{Short|string = http://en.wikipedia.org/wiki/Mediawiki#Extensions|count=30}}...]

{{Short|string=http://en.wikipedia.org/wiki/Mediawiki#Extensions|count=30}}...