Difference between revisions of "Template:Short"

From FollowTheScore
Jump to: navigation, search
(New page: <includeonly>{{#ifexpr:{{#len: {{{string|}}} }} > {{#expr:{{{count|25}}}+5}}|{{#sub:{{{string|}}}|0|{{{count|25}}}}}{{{suffix|}}}|{{{string|}}}}}</includeonly> <noinclude> ==The template==...)
 
Line 1: Line 1:
<includeonly>{{#ifexpr:{{#len: {{{string|}}} }} > {{#expr:{{{count|25}}}+5}}|{{#sub:{{{string|}}}|0|{{{count|25}}}}}{{{suffix|}}}|{{{string|}}}}}</includeonly>
+
<includeonly>{{#ifexpr:{{#len: {{{string|}}} }} > {{#expr:{{{count|25}}}+5}}|{{#sub:{{{string|}}}|0|{{{count|25}}}}}{{{suffix|}}}|{{{string|}}}}}</includeonly><noinclude>
<noinclude>
 
 
==The template==
 
==The template==
 
<pre>{{#ifexpr:{{#len: {{{string|}}} }} > {{#expr:{{{count|25}}}+5}}|{{#sub:{{{string|}}}|0|{{{count|25}}}}}{{{suffix|}}}|{{{string|}}}}}</pre>
 
<pre>{{#ifexpr:{{#len: {{{string|}}} }} > {{#expr:{{{count|25}}}+5}}|{{#sub:{{{string|}}}|0|{{{count|25}}}}}{{{suffix|}}}|{{{string|}}}}}</pre>

Revision as of 18:02, 23 July 2009

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}}...