Difference between revisions of "Module:Uses Wikidata"

From blackwiki
Jump to navigation Jump to search
blackwiki>Jackmcbarn
m (Changed protection level of Module:Uses Wikidata: less than 150 transclusions, and all on template documentation. semi should be good enough ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite)))
blackwiki>ԱշոտՏՆՂ
m
Line 1: Line 1:
−
local p = {}
+
{{Sister project
−
 
+
| position = {{{position|}}}
−
function p.usesProperty(frame)
+
| project  = data
−
local parent = frame.getParent(frame)
+
| text    = This {{module other|module|template}} uses {{#if:{{{section|}}} | one or more [[Wikidata]] properties; see [[#{{{section}}}|§&nbsp;{{{section}}}]]</span> for details. | the [[Wikidata]] propert{{#if:{{{2|}}}|ies|y}}:
−
local result = ''
+
{{#invoke:Uses Wikidata|usesProperty}}
−
local ii = 1
+
}}}}{{#switch:{{SUBPAGENAME}}
−
while true do
+
|sandbox |testcases |doc= <!--no category-->
−
local p_num = parent.args[ii] or ''
+
|#default=[[Category:{{module other|Modules|Templates}} using data from Wikidata]]
−
if p_num ~= '' then
+
}}<noinclude>{{documentation}}<!-- Add categories to the /doc sub-page --></noinclude>
−
local label = mw.wikibase.label(p_num) or "NO LABEL"
 
−
result = result .. "<li><b><i>[[d:Property:" .. p_num .. "|" .. label .. " <small>(" .. string.upper(p_num) .. ")</small>]]</i></b> (see [[d:Special:WhatLinksHere/Property:" .. p_num .. "|uses]])</li>"
 
−
ii = ii + 1
 
−
else break
 
−
end
 
−
end
 
−
return result
 
−
end
 
−
 
−
return p
 

Revision as of 15:55, 8 August 2015

Template:Sister project

50px Module documentation[view] [edit] [history] [purge]

This module is used by Template:Uses Wikidata, Template:Tracks Wikidata and Template:Wikidata property.

Usage

{{#invoke:Uses Wikidata|usesProperty}}