Template:For loop delimited/doc
Template page
More actions
| This is a documentation subpage for Template:For loop delimited. It may contain usage information, categories and other content that is not part of the original template page. |
This is a simplified wrapper for Template:For nowiki. It allows you to iterate over a custom delimited list.
The expected use case for this is to simplify passing lists between templates.
Usage
- {{For loop delimited|separator|delimited string|call=call}}
- {{For loop delimited|separator|delimited string|delim=delim|call=call}}
- {{For loop delimited|separator|delimited string|delim=delim|nowikistart=prefix|nowikiend=postfix}}
Parameters
separator (required)defines how the items are separateddelimited string (requiredis a string separated bydelimdelim (optional)the delimiter for the string, defaults to,- Calling (one is required)
calltemplate (that takes one unnamed argument) to call (ex, 3x).nowikistartandnowikiend. Code to be placed before and after each param value (ex: for 3x, respectively use<nowiki>{{3x|</nowiki>and<nowiki>}}</nowiki>) Both are required if used
Notes
- Leading and trailing spaces are stripped from delims. ie:
{{For loop delimited|--|a,b,c,d|call=3x}}{{For loop delimited|--|a, b, c, d|call=3x}}{{For loop delimited|--|a,b,c,d|delim=, |call=3x}}{{For loop delimited|--|a ,b ,c ,d |delim=,|call=3x}}
- all return:
- aaa--bbb--ccc--ddd
Examples
| Markup | Renders as |
|---|---|
|
aaa--bbb--ccc--ddd |
|
aaa--bbb--ccc--ddd |
|
aaa--bbb--ccc--ddd |
|
aaa--bbb--ccc--ddd |