« Modèle:Hp-chapter-block » : différence entre les versions
m (1 révision importée : importer pages, templates etc de PPR-FR - X3) |
(Remove SMW - use new template Get-chapter-page-name-from-letter) |
||
(4 versions intermédiaires par le même utilisateur non affichées) | |||
Ligne 1 : | Ligne 1 : | ||
<includeonly>{{#vardefine:chapter-toc-page|{{ | <includeonly>{{#vardefine:chapter-toc-page|{{Get-chapter-page-name-from-letter|letter={{{letter|?}}} }}}}{{#vardefine:chapter-icon|Hp-chapter-{{{letter|}}}.png}}<div class="col"> | ||
<div class="hp-chapter"> | <div class="hp-chapter"> | ||
[[file:{{#var:chapter-icon}} | link={{#var:chapter-toc-page}} | {{{alt-text|missing alt text!}}} | class=hp-chapter-img ]]<h4>[[{{#var:chapter-toc-page}} | {{#tag:span | {{#if: {{{letter|}}} | {{#tag:span | {{{letter|}}}. |class=hp-chapter-letter}}|}}{{#if: {{{link-text|}}}|{{{link-text}}}|{{#var:chapter-toc-page}}}} | title={{{alt-text|missing alt text!}}} }} ]]</h4> | [[file:{{#var:chapter-icon}} | link={{#var:chapter-toc-page}} | {{{alt-text|missing alt text!}}} | class=hp-chapter-img ]]<h4>[[{{#var:chapter-toc-page}} | {{#tag:span | {{#if: {{{letter|}}} | {{#tag:span | {{{letter|}}}. |class=hp-chapter-letter}}|}}{{#if: {{{link-text|}}}|{{{link-text}}}|{{#var:chapter-toc-page}}}} | title={{{alt-text|missing alt text!}}} }} ]]</h4>{{#if:{{{new|}}}|[[File:icon_new.svg|class=icon_new|link=]]}}</div> | ||
</div> | |||
</div></includeonly> | </div></includeonly> | ||
<noinclude> | <noinclude> | ||
Ligne 24 : | Ligne 23 : | ||
"label": "Link text", | "label": "Link text", | ||
"description": "The text of the link (if different from the chapter page name)" | "description": "The text of the link (if different from the chapter page name)" | ||
}, | |||
"new": { | |||
"label": "new", | |||
"description": "add new=yes to add a NEW icon to the chapter card", | |||
"type": "boolean" | |||
} | } | ||
}, | }, | ||
"description": "Used to add one chapter \"component\" on homepage table of content.\n\nThe \"link-text\" parameter should generally be omitted (only needed if a chapter page name is too long and needs to be shortened)\n\nTwo elements are | "description": "Used to add one chapter \"component\" on homepage table of content.\n\nThe \"link-text\" parameter should generally be omitted (only needed if a chapter page name is too long and needs to be shortened).\n\nTwo elements are deduced from the chapter-letter:\n* the chapter page name is fetched automatically using a dedicated template (which uses a Cargo query for that)\n* the chapter icon image file name = \"File:Hp-chapter-<chapter-letter>.png\"" | ||
} | } | ||
</templatedata> | </templatedata> | ||
</noinclude> | </noinclude> |
Dernière version du 2 septembre 2025 à 13:50
Used to add one chapter "component" on homepage table of content. The "link-text" parameter should generally be omitted (only needed if a chapter page name is too long and needs to be shortened). Two elements are deduced from the chapter-letter:
- the chapter page name is fetched automatically using a dedicated template (which uses a Cargo query for that)
- the chapter icon image file name = "File:Hp-chapter-<chapter-letter>.png"
Paramètre | Description | Type | État | |
---|---|---|---|---|
chapter letter | letter | the letter (A..S) of the chapter
| Inconnu | suggéré |
alt text to show on mouse hover | alt-text | The alt text to show on mouse hover
| Inconnu | suggéré |
Link text | link-text | The text of the link (if different from the chapter page name) | Inconnu | facultatif |
new | new | add new=yes to add a NEW icon to the chapter card | Booléen | facultatif |