« Module:Bandeau de rubrique » : différence entre les versions

aucun résumé des modifications
Kharmitch (discussion | contributions)
Aucun résumé des modifications
Aucun résumé des modifications
 
Ligne 112 : Ligne 112 :
text    = function(args)
text    = function(args)
local link = args[1]
local link = args[1]
local display = args['t1'] or link
if not link then return "Lien ?" end
if not link then return '' end
local text
if args[2] then
text = "Articles principaux : "
else
text = "Article principal : "
end
text = '[[' .. link .. '|' .. display .. ']]'
local linkText = args["t1"] or link
text = text .. "[[:" .. link .. "|" .. linkText .. "]]"
local many = false
for i = 2, 5 do
for i = 2, 5 do
local link = args[i]
link = args[i]
local display = args['t' .. i] or link
if link then
if link then
many = true
linkText = args["t" .. i] or link
text = text .. ', [[' .. link .. '|' .. display .. ']]'
text = text .. ", [[:" .. link .. "|" .. linkText .. "]]"
else
else
break
break
end
end
end
if many then
text = 'Articles principaux : ' .. text
else
text = 'Article principal : ' .. text
end
end