« Module:Infobox/Configs/Localite » : différence entre les versions
De Nefald
Autres actions
m Hiob a déplacé la page Module:Infobox/Configs/Localite vers Module:Infobox/Configs/localite |
Ajout catégorisation restreinte par liste Balises : Modification par mobile Modification par le web mobile |
||
(2 versions intermédiaires par le même utilisateur non affichées) | |||
Ligne 3 : | Ligne 3 : | ||
return args.nom or '{{PAGENAME}}' | return args.nom or '{{PAGENAME}}' | ||
end, | end, | ||
-- Icône avec type et nom | |||
icone = { | |||
type = 'fas', -- ou 'fab', 'far', 'fal', 'fad' | |||
nom = 'map-location-dot' | |||
}, | |||
image = function(args) | image = function(args) | ||
if args.image then | if args.image then | ||
Ligne 14 : | Ligne 20 : | ||
return nil | return nil | ||
end, | end, | ||
-- Configuration du champ "type" avec validation et catégorisation | |||
typeField = { | |||
required = false, -- Optionnel pour les localités | |||
allowedValues = { | |||
['ville'] = { | |||
display = 'Ville', | |||
category = 'Villes' | |||
}, | |||
['village'] = { | |||
display = 'Village', | |||
category = 'Villages' | |||
}, | |||
['cité'] = { | |||
display = 'Cité', | |||
category = 'Cités' | |||
}, | |||
['capitale'] = { | |||
display = 'Capitale', | |||
category = 'Capitales' | |||
}, | |||
['port'] = { | |||
display = 'Port', | |||
category = 'Ports' | |||
}, | |||
['forteresse'] = { | |||
display = 'Forteresse', | |||
category = 'Forteresses' | |||
}, | |||
['château'] = { | |||
display = 'Château', | |||
category = 'Châteaux' | |||
}, | |||
['ruine'] = { | |||
display = 'Ruine', | |||
category = 'Ruines' | |||
}, | |||
['avant-poste'] = { | |||
display = 'Avant-poste', | |||
category = 'Avant-postes' | |||
}, | |||
['campement'] = { | |||
display = 'Campement', | |||
category = 'Campements' | |||
}, | |||
['métropole'] = { | |||
display = 'Métropole', | |||
category = 'Métropoles' | |||
}, | |||
['sanctuaire'] = { | |||
display = 'Sanctuaire', | |||
category = 'Sanctuaires' | |||
} | |||
}, | |||
errorMessage = 'Type de localité non reconnu. Types autorisés : ville, village, cité, capitale, port, forteresse, château, ruine, avant-poste, campement, métropole, sanctuaire' | |||
}, | |||
sections = { | sections = { | ||
Ligne 25 : | Ligne 87 : | ||
{ cle = 'symbole', label = 'Symbole' }, | { cle = 'symbole', label = 'Symbole' }, | ||
{ cle = 'statut', label = 'Statut' }, | { cle = 'statut', label = 'Statut' }, | ||
{ cle = 'x', label = 'Coordonnée X' }, | { cle = 'x', label = 'Coordonnée X' }, | ||
{ cle = 'y', label = 'Coordonnée Y' }, | { cle = 'y', label = 'Coordonnée Y' }, | ||
{ cle = 'z', label = 'Coordonnée Z' } | { cle = 'z', label = 'Coordonnée Z' } | ||
} | } |
Dernière version du 27 septembre 2025 à 06:55
La documentation pour ce module peut être créée à Module:Infobox/Configs/Localite/doc
local config = {
titre = function(args)
return args.nom or '{{PAGENAME}}'
end,
-- Icône avec type et nom
icone = {
type = 'fas', -- ou 'fab', 'far', 'fal', 'fad'
nom = 'map-location-dot'
},
image = function(args)
if args.image then
return {
nom = args.image,
taille = args.tailleimage or "250px",
legende = args.legende
}
end
return nil
end,
-- Configuration du champ "type" avec validation et catégorisation
typeField = {
required = false, -- Optionnel pour les localités
allowedValues = {
['ville'] = {
display = 'Ville',
category = 'Villes'
},
['village'] = {
display = 'Village',
category = 'Villages'
},
['cité'] = {
display = 'Cité',
category = 'Cités'
},
['capitale'] = {
display = 'Capitale',
category = 'Capitales'
},
['port'] = {
display = 'Port',
category = 'Ports'
},
['forteresse'] = {
display = 'Forteresse',
category = 'Forteresses'
},
['château'] = {
display = 'Château',
category = 'Châteaux'
},
['ruine'] = {
display = 'Ruine',
category = 'Ruines'
},
['avant-poste'] = {
display = 'Avant-poste',
category = 'Avant-postes'
},
['campement'] = {
display = 'Campement',
category = 'Campements'
},
['métropole'] = {
display = 'Métropole',
category = 'Métropoles'
},
['sanctuaire'] = {
display = 'Sanctuaire',
category = 'Sanctuaires'
}
},
errorMessage = 'Type de localité non reconnu. Types autorisés : ville, village, cité, capitale, port, forteresse, château, ruine, avant-poste, campement, métropole, sanctuaire'
},
sections = {
{
titre = 'Informations Générales',
champs = {
{ cle = 'type', label = 'Type' },
{ cle = 'fondation', label = 'Fondation' },
{ cle = 'destruction', label = 'Destruction' },
{ cle = 'fondateur', label = 'Fondateur(s)' },
{ cle = 'symbole', label = 'Symbole' },
{ cle = 'statut', label = 'Statut' },
{ cle = 'x', label = 'Coordonnée X' },
{ cle = 'y', label = 'Coordonnée Y' },
{ cle = 'z', label = 'Coordonnée Z' }
}
},
{
titre = 'Organisation Interne',
champs = {
{ cle = 'dirigeant', label = 'Dirigeant' },
{ cle = 'population', label = 'Population' },
{ cle = 'culte', label = 'Culte' },
{ cle = 'organisation_rattachee', label = 'Organisation rattachée' },
{ cle = 'gouvernement', label = 'Type de gouvernement' },
{ cle = 'quartiers', label = 'Quartiers' }
}
},
{
titre = 'Économie et Société',
champs = {
{ cle = 'activite', label = 'Activité' },
{ cle = 'ressources', label = 'Ressources' },
{ cle = 'monnaie', label = 'Monnaie' },
{ cle = 'commerce', label = 'Commerce' },
{ cle = 'culture', label = 'Culture' },
{ cle = 'langues', label = 'Langues' }
}
},
{
titre = 'Géographie',
champs = {
{ cle = 'monde', label = 'Monde' },
{ cle = 'climat', label = 'Climat' },
{ cle = 'biome', label = 'Biome' },
{ cle = 'relief', label = 'Relief' },
{ cle = 'superficie', label = 'Superficie' },
{ cle = 'cours_eau', label = 'Cours d\'eau' },
{ cle = 'batiments', label = 'Bâtiments notables' }
}
}
}
}
return config