Modulo:DTBase: differenze tra le versioni
Vai alla navigazione
Vai alla ricerca
mNessun oggetto della modifica |
mNessun oggetto della modifica |
||
Riga 371: | Riga 371: | ||
function p.ListReferences(frame) | function p.ListReferences(frame) | ||
local AllReferences = {} | local AllReferences = {} | ||
local | local Item = mw.wikibase.getEntityIdForCurrentPage() | ||
if not | if not Item then | ||
Item = 'Q1' | |||
end | end | ||
local Statements = mw.wikibase.getAllStatements(Item, 'P58') | |||
if not Statements then | |||
return "Nessun riferimento trovato" | |||
else | |||
for _, Statement in pairs(Statements) do | for _, Statement in pairs(Statements) do | ||
local Reference = mw.wikibase.getSitelink(Statement.mainsnak.datavalue.value.id) | local Reference = mw.wikibase.getSitelink(Statement.mainsnak.datavalue.value.id) | ||
Riga 386: | Riga 388: | ||
end | end | ||
return table.concat(AllReferences, string.char(10)) | return table.concat(AllReferences, string.char(10)) | ||
end | end | ||
end | end | ||
return p | return p |