• Home
  • Random
  • Log in
  • Settings
  • About English Wikipedia @ Freddythechick
English Wikipedia @ Freddythechick

Template:For loop delimited/sandbox

  • Language
  • Watch
  • View source
< Template:For loop delimited
__EXPECTUNUSEDTEMPLATE__This is the template sandbox page for Template:For loop delimited (diff).
Template documentation[view] [edit] [history] [purge]

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.

Contents

  • 1 Usage
    • 1.1 Parameters
    • 1.2 Notes
  • 2 Examples

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 separated
  • delimited string (required is a string separated by delim
  • delim (optional) the delimiter for the string, defaults to ,
  • Calling (one is required)
    • call template (that takes one unnamed argument) to call (ex, 3x).
    • nowikistart and nowikiend. 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:
  • <syntaxhighlight lang="wikitext" inline>

aaa--bbb--ccc--ddd </syntaxhighlight>

  • <syntaxhighlight lang="wikitext" inline>

aaa--bbb--ccc--ddd </syntaxhighlight>

  • <syntaxhighlight lang="wikitext" inline>

aaa--bbb--ccc--ddd </syntaxhighlight>

  • <syntaxhighlight lang="wikitext" inline>

aaa--bbb--ccc--ddd </syntaxhighlight>

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

The above documentation is transcluded from Template:For loop delimited/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://enwiki.freddythechick.net/index.php?title=Template:For_loop_delimited/sandbox&oldid=13264714"
Last edited on 25 July 2024, at 18:44

Languages

      This page is not available in other languages.

      English Wikipedia @ Freddythechick
      • This page was last edited on 25 July 2024, at 18:44.
      • Content is available under Creative Commons Attribution-ShareAlike 4.0 unless otherwise noted.
      • About English Wikipedia @ Freddythechick
      • Desktop