Module:Wikidata-badges
Apparence
La documentation de ce module est générée par le modèle {{Documentation module}}.
Les éditeurs peuvent travailler dans le bac à sable (créer).
Voir les statistiques d'appel depuis le wikicode sur l'outil wstat et les appels depuis d'autres modules.
local p = {}
function p.badges(frame)
local site = frame.args[1]
local id = frame.args[2]
if not site then
return printError("site-not-found")
end
if not id then
id = mw.wikibase.getEntityIdForCurrentPage()
if not id then
return printError("entity-not-found")
end
else
if not mw.wikibase.entityExists(id) then
return printError("entity-not-found")
end
end
local badges = mw.wikibase.getBadges(id, site)
if badges then
return table.concat(badges, "/")
end
end
return p