Template:Hp-chapter-block: Difference between revisions
m (Protected "Template:Hp-chapter-block" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))) |
(add one additional parameter to this template - to add a "new" icon to a chaper "card" in homepage table of contents - copied from PPR-EN) |
||
Line 1: | Line 1: | ||
<includeonly>{{#vardefine:chapter-toc-page|{{#ask: [[Has chapter letter::{{{letter|?}}}]]|format=list|link=none|limit=1}}}}{{#vardefine:chapter-icon|Hp-chapter-{{{letter|}}}.png}}<div class="col-xs-12 col-sm-6 col-md-4"> | <includeonly>{{#vardefine:chapter-toc-page|{{#ask: [[Has chapter letter::{{{letter|?}}}]]|format=list|link=none|limit=1}}}}{{#vardefine:chapter-icon|Hp-chapter-{{{letter|}}}.png}}<div class="col-xs-12 col-sm-6 col-md-4"> | ||
<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> | ||
Line 24: | Line 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" | |||
} | } | ||
}, | }, |
Revision as of 08:03, 22 January 2021
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 deducted from the chapter-letter:
- the chapter page name is fetched automatically using semantic properties (#ask)
- the chapter icon image file name = "File:Hp-chapter-<chapter-letter>.png"
Parameter | Description | Type | Status | |
---|---|---|---|---|
chapter letter | letter | the letter (A..S) of the chapter
| Unknown | suggested |
alt text to show on mouse hover | alt-text | The alt text to show on mouse hover
| Unknown | suggested |
Link text | link-text | The text of the link (if different from the chapter page name) | Unknown | optional |
new | new | add new=yes to add a NEW icon to the chapter card | Boolean | optional |