Open main menu

Changes

Module:Sidebar

187 bytes added, 08:43, 20 March 2013
allow for #invoke with args
function p.sidebar(frame)
local origArgs
-- If called via #invoke, use the args passed into the invoking template.
-- Otherwise, assume we're being called from another module or from the debug
-- console, and args are being passed directly in.
if frame == mw.getCurrentFrame() then
-- We're being called via #invoke. If the invoking template passed any args, use
-- them. Otherwise, use the args that were passed into the template.
origArgs = frame:getParent().args
for k, v in pairs(frame.args) do
origArgs = frame.args
break
end
else
-- We're being called from another module or from the debug console, so assume
-- the args are passed in directly.
origArgs = frame
end
Anonymous user