Jump to content

Module:WikidataCheck

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Happy5214 (talk | contribs) at 10:28, 28 April 2013 (Start). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

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