Modulo:CategoriaMusicale: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
Nessun oggetto della modifica |
grassetto standard |
||
(5 versioni intermedie di un altro utente non mostrate) | |||
Riga 2:
local subject2wikilink = {
['
['
['Brani musicali'] = '[[Brano musicale|brani musicali]]',
['Cantanti'] = '[[Cantante|cantanti]]',
['Disc jockey'] = '[[disc jockey]]',
['EP'] = '[[Extended play|EP]]',
['
['
['
}
Riga 16:
verifica quali delle chiavi della tabella subject2wikilink
è presente all'inizio del titolo della categoria e la memorizza
questa funzione è chiamata sia da p.main che dal template,
tramite il codice {{#invoke:CategoriaMusicale|get_subject}}
]]
function p.get_subject()
Riga 27 ⟶ 29:
end
--[[
questa è la funzione principale che genera il wikicodice per il template,
da invocare con il codice {{#invoke:CategoriaMusicale|main|genere|link_genere}}
]]
function p.main(frame)
local args = frame.args
local genre =
local forced_link =
local subject = p.get_subject()
local text = ""
text = "Questa categoria raggruppa voci su '''" .. subject2wikilink[subject] .. " [[" end
if subject == "Gruppi musicali" or subject == "Musicisti" or subject == "Cantanti" then▼
text = text .. "Categorie correlate:\n<div class=\"colonne_strette\">"
wikitext = wikitext .. string.format("[[:Categoria:%s per nazionalità|%s per nazionalità]]{{·}}", subject, subject)▼
▲ if subject == "Gruppi musicali" or subject == "Musicisti" or subject == "Cantanti" or subject == "Disc jockey" then
▲
end
if subject then
end
▲ wikitext = wikitext .. string.format("[[:Categoria:%s per genere|%s per genere (tutti)]]{{·}}", subject, subject)
-- aggiungi link alle categorie correlate se diverse da quella attuale
for k, v in pairs(subject2wikilink) do
if subject ~= k then
end
end
text = text .. "</div>"
return
end
|