Difference between revisions of "Module:sandbox/propertyID"

From Rhizome Catalog
Jump to: navigation, search
(Created page with "local p = {} function p.id(frame) if not mw.wikibase then return "no mw.wikibase" end entity = mw.wikibase.getEntityObject() if entity == nil then...")
(No difference)

Revision as of 00:13, 9 May 2016


local p = {}

function p.id(frame)
    if not mw.wikibase then
        return "no mw.wikibase"
    end
    entity = mw.wikibase.getEntityObject()
    if entity == nil then
        return "no entity"
    end
    return entity.id
end
 
function p.label(frame)
    return mw.wikibase.label( frame.args[1] )
end

function p.property(frame)
    return mw.wikibase.resolvePropertyId( frame.args[1] )         
end    

return p