Please remember to make use of the DML Wiki Manual of Style and Code of Conduct during your stay.

 Actions

Template

Template:ForEach

From Dragon Mania Legends (DML) Wiki

Template documentation
Note: portions of the template sample may not be visible without values provided.
View or edit this template's documentation. (About template documentation)
Important Icon.png
 
Important: This template is not efficient, as such, its use should be limited

Example(s)

The following icon (files):
File:Fire Dragon Icon.png, File:Wind Dragon Icon.png, Water Dragon Icon.png

Can be specified as:

{{forEach|Fire, Wind, Water|di|2|separator=<br>}}

Which gives:
Fire Dragon Icon.png Fire Dragon
Wind Dragon Icon.png Wind Dragon
Water Dragon Icon.png Water Dragon

Other Examples

This template can also be used (and is used in other templates) like:

  • {{forEach|Fire, Wind, Water|di||separator=<br>}} gives:
    Fire Dragon Fire Dragon Icon.png
    Wind Dragon Wind Dragon Icon.png
    Water Dragon Water Dragon Icon.png
  • {{forEach|Fire, Wind, Water|di|n|separator=<br>}} gives:
    Fire Dragon Icon.png Fire Dragon
    Wind Dragon Icon.png  Wind Dragon
    Water Dragon Icon.png  Water Dragon
  • {{forEach|Fire,Wind,Earth,Energy|ei|40px}} gives:
    FireWindEarthEnergy
  • {{forEach| ,Wind (Element),Earth (Element),Energy (Element)|ctg|separator= {{sp}}--{{sp}} }} gives:
    Wind (Element) -- Earth (Element) -- Energy (Element) -- 

Important

See Also

  • {{ForEachIcon}}, accepts a comma separated list of icon names and turns them into icons using {{i}}.
  • {{ForEachNoTemplate}}, splits a comma-separated list into parts and applies plain-text content before and after each item, if specified.
  • {{ForEachDragon}}, splits a comma-separated list into parts and creates a list of dragons (link then icon) for use in EventBox and other templates.

Splits a comma-separated input list into parts and applies the template name provided, to each part. A separator like <br> can also be passed, which is added after each template. Only one parameter is supported for template name. Works for up to 15 comma-separated items. Do not use on large sets of items as doing so this way is VERY inefficient, which is why its use is limited.

Template parameters

ParameterDescriptionTypeStatus
input list1

no description

Example
fire,water,earth
Stringrequired
Template Name2

no description

Stringrequired
Second (specified template) parameter3

no description

Stringoptional
separator (after template)separator

no description

Stringoptional


This Wiki is created by players for other players and is not maintained by, or affiliated with, the game maker (Gameloft).
Cookies help us deliver our services. By using our services, you agree to our use of cookies.