Modulo:Immagine sinottico/sandbox: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
m versione corrente
riscrivo
Riga 27:
 
-- evita letture indesiderate da wikidata
if args[1] == 'no' then return '' end
return ''
end
 
-- controllo quadre in eccesso
-- con args.compatibile restituisce direttamente args[1] e args[2]
if args.compatibile and args[1] and args[1]:sub(1, 1) == '[' then
local catns0 = mw.title.getCurrentTitle().namespace == 0 and catCompatibile or ''
return-- con args[1] ..compatibile restituisce direttamente (args[21] and ('<br />' ..e args[2]) or '') .. cat
if args.compatibile then
local cat = ns0 and catCompatibile or ''
return args[1] .. (args[2] and ('<br />' .. args[2]) or '') .. cat
elseif ns0 then
ret = ret .. catNonCompatibile
end
end
 
Line 50 ⟶ 54:
-- formatta l'immagine
if userval or wdval then
ret = (ret or '') .. formatImage(userval or wdval, args)
end
 
Line 60 ⟶ 64:
-- solo dal qualificatore P2096, altrimenti restituirà una categoria di errore
ret = ret .. (mWikidata._getQualifier({ args['proprietà'], 'P2096', includelang = 'it', n = 1 }) or '')
end
 
-- controllo quadre in eccesso
if not args.compatibile and args[1] and args[1]:sub(1, 1) == '[' and mw.title.getCurrentTitle().namespace == 0 then
ret = ret .. catNonCompatibile
end