This wiki is a XML full dump clone of "Heroes Wiki", the main wiki about the Heroes saga that has been shut down permanently since June 1, 2020. The purpose of this wiki is to keep online an exhaustive and accurate database about the franchise.
Template:EnglishList: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
imported>MiamiVolts No edit summary |
imported>MiamiVolts fix usage |
||
| Line 1: | Line 1: | ||
<includeonly>{{#if:{{{text|}}}|{{#if:{{{sep|}}}|{{#sub:{{{text}}}|0|{{#expr:{{#rpos:{{{text}}}|{{{sep}}}}}+{{#len:{{{sep}}}}}}}}}{{#if:{{{andstr|}}}|{{{andstr}}}|  and  }}{{#sub:{{{text}}}|{{#expr:{{#rpos:{{{text}}}|{{{sep}}}}}+{{#len:{{{sep}}}}}}}}}|{{#sub:{{{text}}}|0|{{#expr:{{#rpos:{{{text}}}|,}}+5}}}}{{#if:{{{andstr|}}}|{{{andstr}}}|  and  }}{{#sub:{{{text}}}|{{#expr:{{#rpos:{{{text}}}|,}}+5}}}}}}}}</includeonly><noinclude> |
<includeonly>{{#if:{{{text|}}}|{{#if:{{{sep|}}}|{{#sub:{{{text}}}|0|{{#expr:{{#rpos:{{{text}}}|{{{sep}}}}}+{{#len:{{{sep}}}}}}}}}{{#if:{{{andstr|}}}|{{{andstr}}}|  and  }}{{#sub:{{{text}}}|{{#expr:{{#rpos:{{{text}}}|{{{sep}}}}}+{{#len:{{{sep}}}}}}}}}|{{#sub:{{{text}}}|0|{{#expr:{{#rpos:{{{text}}}|,}}+5}}}}{{#if:{{{andstr|}}}|{{{andstr}}}|  and  }}{{#sub:{{{text}}}|{{#expr:{{#rpos:{{{text}}}|,}}+5}}}}}}}}</includeonly><noinclude> |
||
== Usage == |
== Usage == |
||
This template acts as a function to convert a comma or other seperated list string into an english list (a list with the word "and" or "or" before the last element). |
This template acts as a function to convert a comma or other seperated list string into an english list (a list with the word "and" or "or" before the last element). It is designed to be combined with inline DPL lists. |
||
<pre> |
<pre> |
||
{{EnglishList |
{{EnglishList |
||
Revision as of 04:39, 21 December 2007
Usage
This template acts as a function to convert a comma or other seperated list string into an english list (a list with the word "and" or "or" before the last element). It is designed to be combined with inline DPL lists.
{{EnglishList
|text=<List of items>
|sep=<Optional separator string/character that exists between words;
default is the ascii comma code (,)>
|andstr=<Optional string to use instead of " and ".
A typical application may use " or " instead.
Note: to get spacing correct, you need to use the ascii space code ( )
(i.e. "  or  ")
}}