Changes

Jump to: navigation, search

Module:Yesno

287 bytes added, 00:35, 23 March 2013
get arguments from the parent frame if the current frame doesn't have any
local p = {}
function p.yesno( frame )
-- defaults
-- Allow arguments to override defaults.
-- 'any' tracks the presence of any arguments at all.
local args = frame.args
local any = false
for k,v in pairs( frame.args ) do
any = true
retvals[k] = v
end
-- If there are no arguments, try and get them from the parent frame.
if any == false then
local pframe = frame:getParent()
args = pframe.args
for k,v in pairs(args) do
any = true
retvals[k] = v
end
end
val = frame.args[1]
-- According to the template docs, the input should be considered nil
Anonymous user

Navigation menu