Module:Template wrapper: Difference between revisions

ignore empty or positional default parameters;
en>Trappist the monk
m (doc tweak;)
en>Trappist the monk
(ignore empty or positional default parameters;)
Line 47: Line 47:


for k, v in pairs (frame_args) do -- here we get the wrapper template's 'default' parameters
for k, v in pairs (frame_args) do -- here we get the wrapper template's 'default' parameters
if '_template' == k then
if 'string' == type (k) and (v and ('' ~= v)) then -- do not pass along positional or empty parameters
template = v; -- save the name of template that we are wrapping
if '_template' == k then
elseif '_exclude' ~= k then -- _exclude already handled so ignore it here
template = v; -- save the name of template that we are wrapping
add_parameter (k, v, args, list); -- add all other parameters to args in the style dictated by list
elseif '_exclude' ~= k then -- _exclude already handled so ignore it here
add_parameter (k, v, args, list); -- add all other parameters to args in the style dictated by list
end
end
end
end
end
Anonymous user