Modulo:StagioniTV/sandbox: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
Nessun oggetto della modifica
err.
Riga 21:
 
function p._prova(args)
local template, sfondo, categoria, target, stagioneoedizione, title, preposizione, errore
local id, localID, tipo, titolo, etichetta, sitelink, stagioni
local pageTitle = args[1] or args.titolo
Riga 28:
if string.find(mw.title.getCurrentTitle().text, '^Episodi d[ei]') then
localID = wikidata._getProperty({ 'P361', n = 1, from = mw.wikibase.getEntityIdForCurrentPage(), formatting = 'raw' })
else localID = nil
end
if localID ~= nil then
Riga 40 ⟶ 39:
else tipo = 'programma'
end
if id then
titolo = wikidata._getLink({ id })
etichetta = wikidata._getLabel({ id, 'it'})
sitelink = mw.wikibase.sitelink( id )
stagioni = wikidata._getProperty({ 'P2437', n = 1, from = id, formatting = 'raw' })
else errore = 'Template non compilato correttamente, controlla le istruzioni'
end
 
local tbl = {}
Riga 90 ⟶ 92:
local links = mw.text.listToText(tbl, sep, sep) .. (categoria or '')
if not id or not etichetta or not stagioni then
if not localID then template = mw.title.getCurrentTitle().namespace == 0 and errorCategory or nil
end
end
if not etichetta or not stagioni then
template = mw.title.getCurrentTitle().namespace == 0 and errorCategory or nil
elseif args[2] == 'elenco' then template = links
Riga 108 ⟶ 106:
end
 
return template, errore
end