« Module:Infobox » : différence entre les versions
De Nefald
Autres actions
mAucun résumé des modifications |
Aucun résumé des modifications |
||
Ligne 8 : | Ligne 8 : | ||
local args = getArgs(frame, {parentFirst = true}) | local args = getArgs(frame, {parentFirst = true}) | ||
-- | -- Récupérer le type d'infobox depuis les arguments du frame | ||
local infoboxType = frame.args[1] or frame.args.type | local infoboxType = frame.args[1] or frame.args.type | ||
if not infoboxType or infoboxType == '' then | if not infoboxType or infoboxType == '' then | ||
Ligne 15 : | Ligne 15 : | ||
-- Récupérer la configuration | -- Récupérer la configuration | ||
local config = configs | local config = configs[infoboxType] -- ✅ Changement ici | ||
if not config then | if not config then | ||
return '<div class="error">Type d\'infobox inconnu : ' .. infoboxType .. '</div>' | return '<div class="error">Type d\'infobox inconnu : ' .. infoboxType .. '</div>' |