Module:WikidataCheck

From Random Island Wiki
Revision as of 05:28, 28 April 2013 by >Happy5214 (Start)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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

local p = {}

function p.wikidatacheck(frame)
    local pframe = frame:getParent()
    local config = frame.args -- the arguments passed BY the template, in the wikitext of the template itself
    local args = pframe.args -- the arguments passed TO the template, in the wikitext that transcludes the template
    
    local property = args.property
    
    local entity = mw.wikibase.getEntity()
    local propValue = entity.claims[property][0].mainsnak.datavalue.value
    return propValue
end