Module:Foreach

-- Replace http://www.mediawiki.org/wiki/Template:Foreach --

local p = {}

function p.foreach(frame) local tplname = frame.args[1] local delim = frame.args[2] or nil finalstr = '' for n,v in frame:argumentPairs do      if n > 3 and delim then finalstr = finalstr .. delim end if n>2 then finalstr = finalstr .. frame:expandTemplate{title = tplname, args = {v}} end end return finalstr end return p