Modul:PropertyLink: Unterschied zwischen den Versionen
Keine Bearbeitungszusammenfassung |
Keine Bearbeitungszusammenfassung |
||
Zeile 47: | Zeile 47: | ||
function getLabels( propertyName ) | function getLabels( propertyName ) | ||
local entity = mw.wikibase.getEntity() | local entity = mw.wikibase.getEntity('Q29') | ||
if not entity or not entity.claims then return end--the entity doesnt exist or have no claims | if not entity or not entity.claims then return end--the entity doesnt exist or have no claims | ||
local properties = entity.claims[propertyName] | local properties = entity.claims[propertyName] | ||
if not properties then return end--no such property for this item | if not properties then return table.getn(entity.claims) end--no such property for this item | ||
local retVal = '' | local retVal = 'lol' | ||
for property in pairs(properties) do | for property in pairs(properties) do | ||
local propValue = property.mainsnak.datavalue | local propValue = property.mainsnak.datavalue |