Modulo:Interprogetto/sandbox: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
disabilito il controllo della proprietà per la categoria quando già l'interlink è una categoria |
aggiungo funzione getClaim e controllo della proprietà P935 |
||
Riga 121:
if self.entity then
return self.entity:getLabel(label)
else
return nil
end
end
function Wikidata_entity:getClaim(property_id)
else
return nil
Line 138 ⟶ 148:
self.from_property_category[key_progetto] = false
end
local claim
if progetto.property_category and self.from_property_category[key_progetto] ~= false then
if
▲ and self.entity.claims[property_id]
▲ and self.entity.claims[property_id][1].mainsnak
▲ and self.entity.claims[property_id][1].mainsnak.datavalue
▲ and self.entity.claims[property_id][1].mainsnak.datavalue.type == 'string' then
▲ self.collegamenti[key_progetto] = 'Category:' .. self.entity.claims[property_id][1].mainsnak.datavalue.value
self.from_property_category[key_progetto] = true▼
end
end
Line 168 ⟶ 174:
self.badge[key_progetto].class = table.concat(badge_class, ' ' )
self.badge[key_progetto].title = table.concat(badge_title, ', ' )
end
elseif not self.is_category and progetto.property_gallery and not self.from_property_category[key_progetto] then
claim = self:getClaim(progetto.property_gallery)
if claim then
end
end
Line 420 ⟶ 431:
local article_link
-- recupera il collegamento automatico alla voce (può essere in entity.article_link[key_progetto] o
-- in entity.collegamento[key_progetto] a seconda del sitelink e della proprietà per
if entity.from_property_category[key_progetto] then
article_link = entity.article_link[key_progetto]
|