« Module:Infobox/doc » : différence entre les versions
De Nefald
Autres actions
Aucun résumé des modifications |
|||
| (18 versions intermédiaires par 2 utilisateurs non affichées) | |||
| Ligne 1 : | Ligne 1 : | ||
== Description == | == Description == | ||
Le système d'infobox modulaire permet de créer et gérer facilement différents types d'infobox sur le wiki. Chaque type d'infobox est configuré dans un module séparé pour faciliter la maintenance. | Le système d'infobox modulaire permet de créer et gérer facilement différents types d'infobox sur le wiki. Chaque type d'infobox est configuré dans un module séparé pour faciliter la maintenance. | ||
== Infobox disponibles == | == Infobox disponibles == | ||
* {{Modèle|Infobox | |||
* {{Modèle|Infobox Localité}} - | ;Voir tous les [[:Catégorie:Modèle d'infobox|modèles d'infobox]]: | ||
* {{Modèle|Infobox | * {{m|Modèle:Infobox Edifice}} - {{GETSHORTDESC:Modèle:Infobox Edifice}} | ||
* {{m|Modèle:Infobox Grade}} - {{GETSHORTDESC:Modèle:Infobox Grade}} | |||
* {{m|Modèle:Infobox Géographie}} - {{GETSHORTDESC:Modèle:Infobox Géographie}} | |||
* {{m|Modèle:Infobox Géopolitique}} - {{GETSHORTDESC:Modèle:Infobox Géopolitique}} | |||
* {{m|Modèle:Infobox Localité}} - {{GETSHORTDESC:Modèle:Infobox Localité}} | |||
* {{m|Modèle:Infobox Membre}} - {{GETSHORTDESC:Modèle:Infobox Membre}} | |||
* {{m|Modèle:Infobox Mythe}} - {{GETSHORTDESC:Modèle:Infobox Mythe}} | |||
* {{m|Modèle:Infobox Organisation}} - {{GETSHORTDESC:Modèle:Infobox Organisation}} | |||
* {{m|Modèle:Infobox Ouvrage}} - {{GETSHORTDESC:Modèle:Infobox Ouvrage}} | |||
* {{m|Modèle:Infobox Personnage}} - {{GETSHORTDESC:Modèle:Infobox Personnage}} | |||
* {{m|Modèle:Infobox Plugin}} - {{GETSHORTDESC:Modèle:Infobox Plugin}} | |||
* {{m|Modèle:Infobox Transport}} - {{GETSHORTDESC:Modèle:Infobox Transport}} | |||
== Utilisation == | == Utilisation == | ||
| Ligne 20 : | Ligne 32 : | ||
== Création d'une nouvelle infobox == | == Création d'une nouvelle infobox == | ||
=== Étape 1 : Créer la configuration === | === Étape 1 : Créer la configuration === | ||
Créez une sous-page dans | Créez une sous-page dans : | ||
<pre> | <pre> | ||
Module:Infobox/Configs/<NomType> | |||
</pre> | |||
avec cette structure : | |||
<pre> | |||
config | local config = { | ||
titre = function(args) | |||
return args.nom or '{{PAGENAME}}' | |||
nom | end, | ||
image = function(args) | |||
if args.image then | |||
return { | |||
nom = args.image, | |||
taille = args.tailleimage or "250px", | |||
{ | legende = args.legende | ||
} | |||
end | |||
return nil | |||
end, | |||
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' }, -- Ces champs seront remplacés automatiquement | |||
{ cle = 'y', label = 'Coordonnée Y' }, -- par l'affichage "Coordonnées" groupé | |||
{ 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' } | |||
} | |||
} | |||
} | } | ||
} | } | ||
| Ligne 77 : | Ligne 112 : | ||
</pre> | </pre> | ||
=== Étape 2 : | === Étape 2 : Créer le modèle === | ||
Créez : | |||
<pre>{{Modèle:Infobox_Organisation}}</pre> | |||
avec ce contenu : | |||
<pre> | <pre> | ||
<includeonly><templatestyles src="Infobox/styles.css" />{{#invoke:Infobox|main|Localite | |||
| nom = {{{nom|{{{1|}}}}}} | |||
| soustitre = {{{soustitre|}}} | |||
| image = {{{image|}}} | |||
} | | tailleimage = {{{tailleimage|}}} | ||
| legende = {{{legende|}}} | |||
| type = {{{type|}}} | |||
=== | | fondation = {{{fondation|}}} | ||
| destruction = {{{destruction|}}} | |||
| fondateur = {{{fondateur|}}} | |||
| symbole = {{{symbole|}}} | |||
| statut = {{{statut|}}} | |||
| monde = {{{monde|}}} | |||
| x = {{{x|}}} | |||
| y = {{{y|}}} | |||
| z = {{{z|}}} | |||
| dirigeant = {{{dirigeant|}}} | |||
| population = {{{population|}}} | |||
| culte = {{{culte|}}} | |||
| organisation_rattachee = {{{organisation_rattachee|}}} | |||
| activite = {{{activite|}}} | |||
| ressources = {{{ressources|}}} | |||
}}</includeonly><noinclude> | |||
{{Documentation}} | |||
</noinclude> | |||
</pre> | </pre> | ||
| Ligne 99 : | Ligne 151 : | ||
* {{Module|Infobox/Configs}} | * {{Module|Infobox/Configs}} | ||
* {{Module|Infobox}} | * {{Module|Infobox}} | ||
<pre> | |||
* Modèle:Infobox <NomType> | |||
</pre> | |||
<!-- | |||
== Types de champs disponibles == | == Types de champs disponibles == | ||
=== Types de base === | === Types de base === | ||
| Ligne 117 : | Ligne 174 : | ||
* '''defaut_legende''' - Champ à utiliser comme légende par défaut (pour les images) | * '''defaut_legende''' - Champ à utiliser comme légende par défaut (pour les images) | ||
* '''champs''' - Liste des champs à combiner (pour coordonnées) | * '''champs''' - Liste des champs à combiner (pour coordonnées) | ||
--> | |||
== Structure technique == | == Structure technique == | ||
| Ligne 123 : | Ligne 181 : | ||
* {{Module|Infobox/Core}} - Logique de rendu HTML | * {{Module|Infobox/Core}} - Logique de rendu HTML | ||
* {{Module|Infobox/Configs}} - Gestionnaire des configurations | * {{Module|Infobox/Configs}} - Gestionnaire des configurations | ||
;Liste des configurations des différents modèles d'infoboxes: | |||
{{#dpl: | |||
|titlematch = Infobox/Configs/% | |||
|namespace = Module | |||
|shownamespace = true | |||
}} | |||
== Dépannage == | == Dépannage == | ||
| Ligne 137 : | Ligne 202 : | ||
== Catégories == | == Catégories == | ||
Les infobox sont automatiquement catégorisées dans | Les infobox sont automatiquement catégorisées dans [[:Catégorie: Modèle d'infobox]]. | ||
<includeonly>[[Catégorie:Documentation de | <includeonly>[[Catégorie:Module d'infobox]]</includeonly> | ||
<noinclude>[[Catégorie:Documentation de modèle]]</noinclude> | |||