Jump to content

Module:Forward parameters to template call

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Tamzin (talk | contribs) at 23:08, 4 February 2022 (fix). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

local p = {}
local getArgs = require('Module:Arguments').getArgs

function p.main(frame)
	local args = getArgs(frame)
	return p._main(frame, args)
end

function p._main(args)
	local markup = "{{" .. args.template
	for i, val in ipairs(args) do
		markup = markup .. "|" .. i .. "=" .. val
	end
	return markup .. "}}"
end

return p