66 411
contributi
m (Added description for DE language) |
mNessun oggetto della modifica |
||
(7 versioni intermedie di uno stesso utente non sono mostrate) | |||
Riga 368: | Riga 368: | ||
return table.concat("* " .. AllP, string.char(10)) | return table.concat("* " .. AllP, string.char(10)) | ||
end | |||
function p.ListReferences(frame) | |||
local AllReferences = {} | |||
local Item = mw.wikibase.getEntityIdForCurrentPage() | |||
if not Item then | |||
Item = 'Q1' | |||
end | |||
local Statements = mw.wikibase.getAllStatements(Item, 'P58') | |||
if not Statements then | |||
return "Nessun riferimento trovato" | |||
else | |||
for _, Statement in pairs(Statements) do | |||
local Reference = mw.wikibase.getSitelink(Statement.mainsnak.datavalue.value.id) | |||
if not Reference then | |||
Reference = Statement.mainsnak.datavalue.value.id | |||
end | |||
if frame.args['AddSemantic'] then | |||
Reference = "Riferimento::" .. Reference | |||
end | |||
AllReferences[#AllReferences + 1] = "* [[" .. Reference .. "]]" | |||
end | |||
return table.concat(AllReferences, string.char(10)) | |||
end | |||
end | end | ||
return p | return p |