« Module:Infobox/Simple » : différence entre les versions

Kims (discussion | contributions)
Page créée avec « --[[ Module:Infobox/Simple ───────────────────── Configuration pour Modèle:Infobox simple — une infobox générique légère utilisée pour les pages ne correspondant à aucune infobox spécialisée (pages de service, calendriers communautaires, méta-pages). Paramètres acceptés par le modèle : | titre, sous-titre, image, légende, icône | ligne1-libellé, ligne1-données | ... jusqu'à ligne8-libe... »
 
Kims (discussion | contributions)
Aucun résumé des modifications
 
Ligne 1 : Ligne 1 :
--[[
Module:Infobox/Simple
─────────────────────
Configuration pour Modèle:Infobox simple — une infobox générique légère
utilisée pour les pages ne correspondant à aucune infobox spécialisée
(pages de service, calendriers communautaires, méta-pages).
Paramètres acceptés par le modèle :
  | titre, sous-titre, image, légende, icône
  | ligne1-libellé, ligne1-données
  | ... jusqu'à ligne8-libellé / ligne8-données
  | pied
]]
local function rowDef(n)
return {
type = 'row',
label = function(localdata)
return localdata['ligne' .. n .. '-libellé']
end,
value = 'ligne' .. n .. '-données',
}
end
return {
return {
parts = {
parts = {
{
{ type = 'title', value = { 'titre', 'nom' }, subtitle = 'sous-titre', icon = 'icône' },
type = 'title',
{ type = 'images', imageparameters = { 'image' }, captionparameter = { 'légende' }},
value = { 'titre', 'nom' },
{ type = 'table', separator = true, title = 'Informations', rows = {
subtitle = 'sous-titre',
{ type = 'row', label = function(localdata) return localdata['libellé1'] end, value = 'donnée1' },
icon = 'icône',
{ type = 'row', label = function(localdata) return localdata['libellé2'] end, value = 'donnée2' },
},
{ type = 'row', label = function(localdata) return localdata['libellé3'] end, value = 'donnée3' },
{
{ type = 'row', label = function(localdata) return localdata['libellé4'] end, value = 'donnée4' },
type = 'images',
{ type = 'row', label = function(localdata) return localdata['libellé5'] end, value = 'donnée5' },
imageparameters = { 'image' },
{ type = 'row', label = function(localdata) return localdata['libellé6'] end, value = 'donnée6' },
captionparameter = 'légende',
{ type = 'row', label = function(localdata) return localdata['libellé7'] end, value = 'donnée7' },
},
{ type = 'row', label = function(localdata) return localdata['libellé8'] end, value = 'donnée8' },
{
}},
type = 'table',
{ type = 'text', value = 'pied' }
rows = {
}
rowDef(1), rowDef(2), rowDef(3), rowDef(4),
rowDef(5), rowDef(6), rowDef(7), rowDef(8),
},
},
{
type = 'text',
value = 'pied',
style = {
['font-size'] = '90%',
['font-style'] = 'italic',
['color'] = '#666',
['font-weight'] = 'normal',
},
},
},
}
}

Dernière version du 25 mai 2026 à 11:00

La documentation pour ce module peut être créée à Module:Infobox/Simple/doc

return {
	parts = {
		{ type = 'title', value = { 'titre', 'nom' }, subtitle = 'sous-titre', icon = 'icône' },
		{ type = 'images', imageparameters = { 'image' }, captionparameter = { 'légende' }},
		{ type = 'table', separator = true, title = 'Informations', rows = {
			{ type = 'row', label = function(localdata) return localdata['libellé1'] end, value = 'donnée1' },
			{ type = 'row', label = function(localdata) return localdata['libellé2'] end, value = 'donnée2' },
			{ type = 'row', label = function(localdata) return localdata['libellé3'] end, value = 'donnée3' },
			{ type = 'row', label = function(localdata) return localdata['libellé4'] end, value = 'donnée4' },
			{ type = 'row', label = function(localdata) return localdata['libellé5'] end, value = 'donnée5' },
			{ type = 'row', label = function(localdata) return localdata['libellé6'] end, value = 'donnée6' },
			{ type = 'row', label = function(localdata) return localdata['libellé7'] end, value = 'donnée7' },
			{ type = 'row', label = function(localdata) return localdata['libellé8'] end, value = 'donnée8' },
		}},
		{ type = 'text', value = 'pied' }
	}
}