Module:Sandbox/BrandonXLF/1

This is an old revision of this page, as edited by BrandonXLF (talk | contribs) at 20:59, 18 February 2019. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

local p = {}
function p.main (frame)
	local fArgs  = frame.args
	local pArgs  = frame:getParent().args
	local tArgs  = {}
	local pFirst = require('Module:Yesno')(fArgs._pf)
	local template = fArgs['_t']
	if not template then
		return require('Module:Error').error({'Error: no template name given.'})
	end
	if pFirst then
		fArgs, pArgs = pArgs, fArgs
	end
	for k,v in pairs(fArgs) do
		tArgs[k] = v
	end
	for k,v in pairs(fArgs) do
		if k ~= '_t' then
			tArgs[k] = v
		end
	end
	return frame:expandTemplate{title = template, args = tArgs}
end
return p