Difference between revisions of "Foreach"
From Sega Retro
(exciting) |
|||
(One intermediate revision by the same user not shown) | |||
Line 22: | Line 22: | ||
|template=Test2 | |template=Test2 | ||
}} | }} | ||
− | + | ---- | |
+ | ---- | ||
<pre> | <pre> | ||
{{foreach | {{foreach | ||
− | |list=Mega Drive-Master System-Saturn-Dreamcast | + | |list=[[Mega Drive]]-[[Master System]]-[[Saturn]]-[[Dreamcast]] |
|delimiter=- | |delimiter=- | ||
|template=Test2 | |template=Test2 | ||
Line 33: | Line 34: | ||
{{foreach | {{foreach | ||
− | |list=Mega Drive-Master System-Saturn-Dreamcast | + | |list=[[Mega Drive]]-[[Master System]]-[[Saturn]]-[[Dreamcast]] |
|delimiter=- | |delimiter=- | ||
|template=Test2 | |template=Test2 | ||
+ | }} | ||
+ | ---- | ||
+ | ---- | ||
+ | <pre> | ||
+ | {{foreach | ||
+ | |list=[[3D Control Pad]], [[Virtua Stick]], [[Virtua Gun]], [[Saturn Twin Stick]] | ||
+ | |delimiter=, | ||
+ | |template=AccessoryCategoryCheck2 | ||
+ | }} | ||
+ | </pre> | ||
+ | |||
+ | {{foreach | ||
+ | |list=[[3D Control Pad]], [[Virtua Stick]], [[Virtua Gun]], [[Saturn Twin Stick]] | ||
+ | |delimiter=, | ||
+ | |template=AccessoryCategoryCheck2 | ||
}} | }} | ||
</noinclude> | </noinclude> |
Latest revision as of 08:12, 21 July 2018
A template for iterating through a list and doing something to each item.
Examples
{{foreach |list=Whoop, gloop, bloop, doop, shoop |delimiter=, |template=Test2 }}
Produces:
- INPUT: Whoop
- NO BRACKETS: Whoop
*INPUT: gloop
- NO BRACKETS: gloop
*INPUT: bloop
- NO BRACKETS: bloop
*INPUT: doop
- NO BRACKETS: doop
*INPUT: shoop
- NO BRACKETS: shoop
{{foreach |list=[[Mega Drive]]-[[Master System]]-[[Saturn]]-[[Dreamcast]] |delimiter=- |template=Test2 }}
Produces:
- INPUT: Mega Drive
- NO BRACKETS: Mega Drive
*INPUT: Master System
- NO BRACKETS: Master System
*INPUT: Saturn
- NO BRACKETS: Saturn
*INPUT: Dreamcast
- NO BRACKETS: Dreamcast
{{foreach |list=[[3D Control Pad]], [[Virtua Stick]], [[Virtua Gun]], [[Saturn Twin Stick]] |delimiter=, |template=AccessoryCategoryCheck2 }}
- name: Foreach
- format: SAT
- accessory: 3D Control Pad
- documented:*name: Foreach
- format: SAT
- accessory: Virtua Stick
- documented:*name: Foreach
- format: SAT
- accessory: Virtua Gun
- documented:*name: Foreach
- format: SAT
- accessory: Saturn Twin Stick
- documented: