« Modèle:Infobox V3/Image/Documentation » : différence entre les versions
Apparence
Aucun résumé des modifications |
Aucun résumé des modifications |
||
| Ligne 10 : | Ligne 10 : | ||
== 🔧 Syntaxe == | == 🔧 Syntaxe == | ||
<syntaxhighlight lang="text"> | <syntaxhighlight lang="text"> | ||
{{Infobox V3/ | {{Infobox V3/Image | ||
| | | Image 1 = Image1.jpg | ||
|Titre | | Titre image 1 = Première image | ||
| | | Image caption 1 = Description 1 | ||
| | | Image 2 = Image2.jpg | ||
|Titre | | Titre image 2 = Deuxième image | ||
| | | Image caption 2 = Description 2 | ||
| Image 3 = Image3.jpg | |||
| Titre image 3 = Troisième image | |||
| Image caption 3 = Description 3 | |||
}} | }} | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| Ligne 30 : | Ligne 33 : | ||
{{Infobox V3/Fin Documentation}} | {{Infobox V3/Fin Documentation}} | ||
<pre> | <pre> | ||
{{Infobox V3/ | {{Infobox V3/Image | ||
|Titre | | Image 1 = Image1.jpg | ||
| | | Titre image 1 = Première image | ||
| | | Image caption 1 = Description 1 | ||
| Image 2 = Image2.jpg | |||
| Titre image 2 = Deuxième image | |||
| Image caption 2 = Description 2 | |||
| Image 3 = Image3.jpg | |||
| Titre image 3 = Troisième image | |||
| Image caption 3 = Description 3 | |||
}} | }} | ||
</pre> | </pre> | ||
| Ligne 40 : | Ligne 49 : | ||
=== Deux portraits === | === Deux portraits === | ||
{{Infobox V3/Début}} | {{Infobox V3/Début}} | ||
{{Infobox V3/ | {{Infobox V3/Image | ||
| | | Image 1 = Image1.jpg | ||
|Titre | | Titre image 1 = Première image | ||
| | | Image caption 1 = Description 1 | ||
| | | Image 2 = Image2.jpg | ||
|Titre | | Titre image 2 = Deuxième image | ||
| | | Image caption 2 = Description 2 | ||
| Image 3 = Image3.jpg | |||
| Titre image 3 = Troisième image | |||
| Image caption 3 = Description 3 | |||
}} | }} | ||
{{Infobox V3/Fin}} | {{Infobox V3/Fin}} | ||
<pre> | <pre> | ||
{{Infobox V3/ | {{Infobox V3/Image | ||
| | | Image 1 = Image1.jpg | ||
|Titre | | Titre image 1 = Première image | ||
| | | Image caption 1 = Description 1 | ||
| | | Image 2 = Image2.jpg | ||
|Titre | | Titre image 2 = Deuxième image | ||
| | | Image caption 2 = Description 2 | ||
| Image 3 = Image3.jpg | |||
| Titre image 3 = Troisième image | |||
| Image caption 3 = Description 3 | |||
}} | }} | ||
</pre> | </pre> | ||
Version du 28 mai 2025 à 18:41
📘 Description
Ce modèle affiche un ou deux portraits dans une infobox, avec un titre et une légende facultatifs. Il s’adapte automatiquement :
- à une seule image, qu’il affiche en grand (250px),
- ou à deux images, qu’il présente dans un onglet interactif avec le modèle
<tabber>.
🔧 Syntaxe
{{Infobox V3/Image
| Image 1 = Image1.jpg
| Titre image 1 = Première image
| Image caption 1 = Description 1
| Image 2 = Image2.jpg
| Titre image 2 = Deuxième image
| Image caption 2 = Description 2
| Image 3 = Image3.jpg
| Titre image 3 = Troisième image
| Image caption 3 = Description 3
}}
🧪 Exemples
Un seul portrait
{{Infobox V3/Image
| Image 1 = Image1.jpg
| Titre image 1 = Première image
| Image caption 1 = Description 1
| Image 2 = Image2.jpg
| Titre image 2 = Deuxième image
| Image caption 2 = Description 2
| Image 3 = Image3.jpg
| Titre image 3 = Troisième image
| Image caption 3 = Description 3
}}
Deux portraits
Infobox V3/Image/Documentation
{{Infobox V3/Image
| Image 1 = Image1.jpg
| Titre image 1 = Première image
| Image caption 1 = Description 1
| Image 2 = Image2.jpg
| Titre image 2 = Deuxième image
| Image caption 2 = Description 2
| Image 3 = Image3.jpg
| Titre image 3 = Troisième image
| Image caption 3 = Description 3
}}
🧩 Paramètres
| Paramètre | Description | Obligatoire |
|---|---|---|
Portrait 1 |
Nom du fichier image principal | Oui ✅ |
Titre portrait 1 |
Titre au-dessus de la première image | Non |
Portrait caption 1 |
Légende sous la première image | Non |
Portrait 2 |
Nom du second fichier image | Non |
Titre portrait 2 |
Titre au-dessus de la deuxième image | Non |
Portrait caption 2 |
Légende sous la deuxième image | Non |
Comportement
- Si
Portrait 2est fourni, les deux portraits sont affichés dans des onglets<tabber>. - Si seul
Portrait 1est présent, il est affiché centré avec son titre et sa légende (si fournis). - Si aucun portrait n’est renseigné, rien ne s’affiche.
🧰 CSS recommandé
Ajoute ces règles à ta page MediaWiki:Common.css si ce n’est pas encore fait :
.infobox-center {
text-align: center;
margin: 0 auto;
}
.infobox-LO {
padding: 0.5em;
}
.infobox-caption {
font-size: 90%;
font-style: italic;
margin-top: 0.3em;
}
