Module:Infobox/Configs/Personnage
De Nefald
Autres actions
La documentation pour ce module peut être créée à Module:Infobox/Configs/Personnage/doc
local config = {
titre = function(args)
return args.nom or '{{PAGENAME}}'
end,
icone = {
type = 'fas',
nom = 'person'
},
image = function(args)
if args.image then
return '[[Fichier:' .. args.image .. '|300px]]'
end
return nil
end,
-- Catégories (uniquement dans le namespace principal)
categories = function(args, config, frame)
local title = mw.title.getCurrentTitle()
-- Si on n'est PAS dans le namespace principal → aucune catégorie
if title.namespace ~= 0 then
return {}
end
-- Sinon on laisse la logique habituelle (à adapter selon ton module)
local cats = {}
-- exemple :
-- table.insert(cats, 'Catégorie:Exemple')
return cats
end,
sections = {
{
titre = 'État civil',
champs = {
{ cle = 'titre', label = 'Titre' },
{ cle = 'surnom', label = 'Surnom' },
{ cle = 'naissance', label = 'Date de naissance' },
{ cle = 'deces', label = 'Date de décès' },
{ cle = 'lieu_naissance', label = 'Lieu de naissance' },
{ cle = 'lieu_residence', label = 'Lieu de résidence' },
{ cle = 'statut', label = 'Statut' },
}
}
}
}
return config