« Module:Infobox/Configs/Localite » : différence entre les versions
De Nefald
Autres actions
Page créée avec « local config = { titre = function(args) return args.nom or '{{PAGENAME}}' end, image = function(args) if args.image then return '300px' end return nil end, sections = { { titre = 'Informations Générales', champs = { { cle = 'type', label = 'Type' }, { cle = 'fondation', label = 'Fondation'... » |
Ajout catégorisation restreinte par liste Balises : Modification par mobile Modification par le web mobile |
||
(7 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 | ||
return | return { | ||
nom = args.image, | |||
taille = args.tailleimage or "250px", | |||
legende = args.legende | |||
} | |||
end | end | ||
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 = { | ||
{ | { |