Module:Taxonbar/confdoc: Difference between revisions

Content deleted Content added
add examples
add start parameter to get output in blocks
Line 26:
-function to show formatURL and id for taxonomic databases
]]
local counter = 10300 --expensive parser function counter
 
function p.wikidataInfo( frame )
counter = frame.args['counter'] or 50300 -- prevent too preventmanymany expensive calls
local start = frame.args['start'] or "a"
local wikitable = '{| class="wikitable sortable"\n' ..
Line 45 ⟶ 47:
local formatterURL = ""
if type(prop) == 'number' and prop > 0 and param > start then
local item = mw.wikibase.getEntity('P'..prop) --('P5354')
counter = counter - 1
if item and item ~= "" then
Line 60 ⟶ 63:
if subjectItem then
local officialWebsite = mw.wikibase.getEntity(subjectItem.mainsnak.datavalue.value.id):getBestStatements('P856')[1]
counter = counter - 1
if officialWebsite then
url = url .. '<br/>website: ' .. officialWebsite.mainsnak.datavalue.value
Line 94 ⟶ 98:
function p.getExamples( propItem , prop, formatterURL, datatype)
counter = counter -1
if counter < 0 then return "count exceeded" end
Line 109 ⟶ 113:
examples = examples .. '\n*[[:d:' .. exampleID .. '|' .. exampleID ..']] <br/>'
local item = mw.wikibase.getEntity(exampleID)
counter = counter - 1
if item and item ~= "" then
--datatype = item.datatype