Difference between revisions 37817 and 37859 on test2wiki-- Expansion demo, like [[m:Template:Xpd]]
-- For calls with unnamed parameters only
local p = {}
function p.f(frame)
local r=''
local t={}
for n,v in frame:argumentPairs() do table.insert (t,{n,v}) end
local tplname
tplargs={}
tplargs[1]=''
for n,v in pairs(t) do
if n~=1 then tplargs[v[1]]=v[2] else tplname=v[2] end end
table.remove (tplargs,1)
r=r..'<code>{{'..tplname..'|'..table.concat(tplargs,'|')..'}}</code> → '
r = r .. frame:expandTemplate{title = tplname, args = tplargs}
return r
end
return p
This site is not affiliated with or endorsed in any way by the Wikimedia Foundation or any of its affiliates. In fact, we fucking despise them.
|