Module:Uses Wikidata: Difference between revisions
made function callable outside of template
(Added bullet symbol as image (see Template talk:Uses Wikidata#Added bullet symbol as image)) |
(made function callable outside of template) |
||
Line 2: | Line 2: | ||
function p.usesProperty(frame) | function p.usesProperty(frame) | ||
local | local args = frame.getParent(frame).args or nil | ||
if args == nil then | |||
args = frame.args | |||
end | |||
local result = '' | local result = '' | ||
local ii = 1 | local ii = 1 | ||
while true do | while true do | ||
local p_num = mw.text.trim( | local p_num = mw.text.trim(args[ii] or '') | ||
if p_num ~= '' then | if p_num ~= '' then | ||
local label = mw.wikibase.label(p_num) or "NO LABEL" | local label = mw.wikibase.label(p_num) or "NO LABEL" |