« Modèle:Infobox V3/Portrait/Documentation » : différence entre les versions
Apparence
Aucun résumé des modifications |
|||
| Ligne 46 : | Ligne 46 : | ||
=== Deux portraits === | === Deux portraits === | ||
<div> | <div> | ||
{{Infobox V3/Début}} | {{Infobox V3/Début Documentation}} | ||
{{Infobox V3/Portrait | {{Infobox V3/Portrait | ||
|Portrait 1=Ejheril Reïls portrait.png | |Portrait 1=Ejheril Reïls portrait.png | ||
| Ligne 58 : | Ligne 58 : | ||
|Portrait caption 3= | |Portrait caption 3= | ||
}} | }} | ||
{{Infobox V3/Fin}} | {{Infobox V3/Fin Documentation}} | ||
<pre> | <pre> | ||
{{Infobox V3/Portrait | {{Infobox V3/Portrait | ||
| Ligne 77 : | Ligne 77 : | ||
=== Trois portraits === | === Trois portraits === | ||
<div> | <div> | ||
{{Infobox V3/Début}} | {{Infobox V3/Début Documentation}} | ||
{{Infobox V3/Portrait | {{Infobox V3/Portrait | ||
|Portrait 1=Ejheril Reïls portrait.png | |Portrait 1=Ejheril Reïls portrait.png | ||
| Ligne 89 : | Ligne 89 : | ||
|Portrait caption 3= | |Portrait caption 3= | ||
}} | }} | ||
{{Infobox V3/Fin}} | {{Infobox V3/Fin Documentation}} | ||
<pre> | <pre> | ||
{{Infobox V3/Portrait | {{Infobox V3/Portrait | ||
Version du 29 mai 2025 à 11:15
📘 Description
Ce modèle affiche jusqu’à trois portraits sous forme d’onglets grâce au système de navigation tabber.
Il adapte automatiquement les images à une taille uniforme (300 px de haut, largeur 100 %) grâce à une classe CSS dédiée.
Ce système permet une présentation élégante et cohérente des portraits dans les infoboxes.
🔧 Syntaxe
Utilisation standard du modèle dans une infobox ou une page :
{{NomDuModèle
| Portrait 1 = NomImage1.jpg
| Titre portrait 1 = Légende 1
| Portrait caption 1 = Description 1
| Portrait 2 = NomImage2.jpg
| Titre portrait 2 = Légende 2
| Portrait caption 2 = Description 2
| Portrait 3 = NomImage3.jpg
| Titre portrait 3 = Légende 3
| Portrait caption 3 = Description 3
}}
🧪 Exemples
Un seul portrait
{{Infobox V3/Portrait
|Titre portrait 1=Portrait officiel
|Portrait 1=Portrait Blad Melkitim.png
|Portrait caption 1=
}}
Deux portraits
{{Infobox V3/Portrait
|Portrait 1=Ejheril Reïls portrait.png
|Titre portrait 1=Portrait officiel
|Portrait caption 1=
|Portrait 2=Ejheril Reïls portrait jeune.png
|Titre portrait 2=Portrait officiel
|Portrait caption 2=
|Portrait 3=
|Titre portrait 3=
|Portrait caption 3=
}}
Trois portraits
{{Infobox V3/Portrait
|Portrait 1=Ejheril Reïls portrait.png
|Titre portrait 1=Portrait officiel
|Portrait caption 1=
|Portrait 2=Ejheril Reïls portrait jeune.png
|Titre portrait 2=Portrait officiel
|Portrait caption 2=
|Portrait 3=Ejheril Reïls portrait jeune.png
|Titre portrait 3=Portrait officiel
|Portrait caption 3=
}}
🧩 Paramètres
| Nom du paramètre | Description | Obligatoire |
|---|---|---|
Portrait 1 |
Nom du fichier de la première image sans le préfixe File: | Oui |
Titre portrait 1 |
Titre affiché au-dessus de la première image | Non |
Portrait caption 1 |
Légende affichée sous la première image | Non |
Portrait 2 |
Nom du fichier de la deuxième image | Non |
Titre portrait 2 |
Titre affiché au-dessus de la deuxième image | Non |
Portrait caption 2 |
Légende affichée sous la deuxième image | Non |
Portrait 3 |
Nom du fichier de la troisième image | Non |
Titre portrait 3 |
Titre affiché au-dessus de la troisième image | Non |
Portrait caption 3 |
Légende affichée sous la troisième image | Non |
⚠️ Les images 2 et 3 sont facultatives. Si seule l’image 1 est renseignée, elle s’affiche seule, sans onglets.
🧰 CSS recommandé
Pour que les portraits aient une taille cohérente et soient automatiquement rognés (crop), ajoute ce code dans MediaWiki:Common.css :
.infobox-portrait-cropped img {
width: 100%;
height: 300px;
object-fit: cover;
object-position: center;
}
Et appelle les images dans le modèle comme ceci :
[[File:{{{Portrait 1}}}|class=infobox-portrait-cropped]]


