« Module:Infobox/Core » : différence entre les versions
De Nefald
Autres actions
mAucun résumé des modifications Balises : Modification par mobile Modification par le web mobile |
m Icone en bas de l'infobox |
||
| Ligne 30 : | Ligne 30 : | ||
end | end | ||
-- Titre sans icône (icône déplacée en bas à droite) | |||
local titleDiv = mw.html.create('div') | local titleDiv = mw.html.create('div') | ||
:addClass('infobox-title') | |||
:wikitext(args.nom) -- Juste le nom, sans icône | |||
header:node(titleDiv) | |||
if args.soustitre and args.soustitre ~= '' then | if args.soustitre and args.soustitre ~= '' then | ||
| Ligne 123 : | Ligne 109 : | ||
root:node(body) | root:node(body) | ||
-- Ajouter l'icône en bas à droite | |||
if config.icone then | |||
local iconeDiv = mw.html.create('div') | |||
:addClass('infobox-icon-bottom') | |||
local iconeType = config.icone.type or 'fas' | |||
local iconeNom = config.icone.nom | |||
local iconeContent = '{{#' .. iconeType .. ':' .. iconeNom .. '}}' | |||
-- Preprocesser le contenu pour interpréter l'icône | |||
if frame then | |||
iconeContent = frame:preprocess(iconeContent) | |||
end | |||
iconeDiv:wikitext(iconeContent) | |||
root:node(iconeDiv) | |||
end | |||
return tostring(root) | return tostring(root) | ||
end | end | ||
return p | return p | ||