Difference between revisions of "Module:sandbox/getProps"

From Rhizome Artbase
Line 2: Line 2:
  
 
function p.getProps(frame)
 
function p.getProps(frame)
     local props = mw.wikibase.entity:getProperties ('Q4940')
+
     for item_num = 4930,4940 do
    return props
+
        local item_id = "Q" .. item_num
 +
        local props = mw.wikibase.entity:getProperties ( item_id )
 +
        if props == nil then
 +
            props = ""
 +
            end
 
     end
 
     end
   
+
return props
 +
end
 
return p
 
return p

Revision as of 01:26, 9 May 2016

Documentation for this module may be created at Module:sandbox/getProps/doc

local p = {}

function p.getProps(frame)
    for item_num = 4930,4940 do
        local item_id = "Q" .. item_num
        local props = mw.wikibase.entity:getProperties ( item_id )
        if props == nil then 
            props = ""
            end
    end
return props
end
return p