Zum Inhalt springen

Modul:PropertyLink: Unterschied zwischen den Versionen

keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Zeile 40: Zeile 40:
     return getLabel( string.lower(frame.args[1] ))
     return getLabel( string.lower(frame.args[1] ))
end
end
 
function getImageLink( propName, width)
function getImageLink( propName, width)
     local entity = mw.wikibase.getEntity()
     local entity = mw.wikibase.getEntity()
     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 property = entity.claims[propName or "P3"]
     local property = entity.claims[propName or "P4"]
     if property then
     if property then
         local width = width or "220"
         local width = width or "220"
         return mw.ustring.format( '[[File:%s|%spx]]', property[0].mainsnak.datavalue.value, width )
         return mw.ustring.format( '[[File:%s|%spx]]', property[1].mainsnak.datavalue.value, width )
     end
     end
end
end
11.008

Bearbeitungen

Cookies helfen uns bei der Bereitstellung von Android Wiki. Durch die Nutzung von Android Wiki erklärst du dich damit einverstanden, dass wir Cookies speichern.