Module:WikidataCheck: Difference between revisions

From Random Island Wiki
Jump to navigation Jump to search
>Happy5214
(Start)
 
>Happy5214
m (Wrong level)
Line 6: Line 6:
     local args = pframe.args -- the arguments passed TO the template, in the wikitext that transcludes the template
     local args = pframe.args -- the arguments passed TO the template, in the wikitext that transcludes the template
      
      
     local property = args.property
     local property = config.property
      
      
     local entity = mw.wikibase.getEntity()
     local entity = mw.wikibase.getEntity()

Revision as of 06:30, 28 April 2013

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 = config.property
    
    local entity = mw.wikibase.getEntity()
    local propValue = entity.claims[property][0].mainsnak.datavalue.value
    return propValue
end