Difference between revisions of "Template:Short"

From FollowTheScore
Jump to: navigation, search
Line 1: Line 1:
<includeonly>{{#ifexpr:{{#len: {{{string|}}} }} > {{#expr:{{{count|25}}}+5}}|{{#sub:{{{string|}}}|0|{{{count|25}}}}}{{{suffix|}}}|{{{string|}}}}}</includeonly><noinclude>
+
<includeonly>{{#ifexpr:{{#len: {{{string|}}} }} > {{#expr:{{{count|25}}}+5}}|{{#sub:{{{string|}}}|0|{{{count|25}}}}}{{{suffix| }}}|{{{string|}}}}}</includeonly><noinclude>
 
This is not finished yet.
 
This is not finished yet.
 
==The template==
 
==The template==
Line 6: Line 6:
 
==Usage==
 
==Usage==
 
This shortens strings. This can be used to shorten URLs or included text.
 
This shortens strings. This can be used to shorten URLs or included text.
;Usage
+
===Usage===
 
<pre>{{Short
 
<pre>{{Short
 
|string =
 
|string =
Line 12: Line 12:
 
|suffix =
 
|suffix =
 
}}</pre>
 
}}</pre>
'''*count''': Optional / Default: 25
+
*'''count''': optional / default: 25
:The number of displayed characters. 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.
+
:The number of displayed characters (white space / blanks are counted).
*'''suffix''': optional / no default for because of wiki markup for URLs
+
: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 ...)
  
;Example URL
+
===Examples===
<pre></pre>
+
<pre>{{Short|string=The number of displayed characters (white space / blanks are counted).|count=30|}}</pre>
 +
{{Short|string=The number of displayed characters (white space / blanks are counted).|count=30}}
 
</noinclude>
 
</noinclude>

Revision as of 18:16, 23 July 2009

This is not finished yet.

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

Examples

{{Short|string=The number of displayed characters (white space / blanks are counted).|count=30|}}

Expression error: Unrecognized punctuation character "{".