Template:Memory: Difference between revisions
Request 7: single tribute icon next to sender name on entries |
Badge-layout restyle for the tribute icon (Request 7 follow-up, bundled with Request 8) |
||
| Line 1: | Line 1: | ||
<div class="memory-entry"> | <div class="memory-entry">{{#switch:{{{tribute|}}}|flowers=<div class="memory-tribute-badge" title="Flowers">💐</div>|fruits=<div class="memory-tribute-badge" title="Fruits">🍎</div>|car=<div class="memory-tribute-badge" title="Car">🚗</div>|house=<div class="memory-tribute-badge" title="House">🏠</div>|money=<div class="memory-tribute-badge" title="Money">💰</div>|#default=}}<div class="memory-content"> | ||
'''{{{name|A Visitor}}}'''{{#if:{{{date|}}}| <span class="memory-date">— {{{date}}}</span>}} | |||
{{#if:{{{photo|}}}|[[File:{{{photo}}}|thumb|{{{caption|}}}]]}} | {{#if:{{{photo|}}}|[[File:{{{photo}}}|thumb|{{{caption|}}}]]}} | ||
<div class="memory-message">{{{message|}}}</div> | <div class="memory-message">{{{message|}}}</div> | ||
</div> | |||
</div> | </div> | ||
---- | ---- | ||
| Line 19: | Line 20: | ||
styling) without also catching the name/date header or the photo. | styling) without also catching the name/date header or the photo. | ||
The tribute icon (when set) renders once, | The tribute icon (when set) renders once, as its own left-column badge | ||
block beside the name/date/message content (see | |||
values render nothing (the <code>#switch</code> default is empty), so every | <code>.memory-tribute-badge</code>/<code>.memory-content</code> in | ||
entry saved before this parameter existed keeps rendering exactly as before. | <code>MediaWiki:Common.css</code>) — not inline text next to the name. | ||
Unset or unrecognized values render nothing at all (the <code>#switch</code> | |||
default is empty, so no badge <code><div></code> is emitted and no | |||
empty column appears), so every entry saved before this parameter existed | |||
keeps rendering exactly as before. | |||
<templatedata> | <templatedata> | ||
| Line 42: | Line 47: | ||
"tribute": { | "tribute": { | ||
"label": "Tribute (optional)", | "label": "Tribute (optional)", | ||
"description": "A | "description": "A tribute icon shown as a badge beside your entry.", | ||
"type": "string", | "type": "string", | ||
"suggestedvalues": ["flowers", "fruits", "car", "house", "money"], | "suggestedvalues": ["flowers", "fruits", "car", "house", "money"], | ||
Revision as of 23:57, 20 September 2026
A Visitor
This template renders one guestbook/memory entry. Used via the "Add a Memory" link on a memorial page — visitors shouldn't normally need to type this by hand.
The photo (when present) renders above the message text, not below it (Devin's request) -- so the photo line comes first in this template, right after the name/date header.
The message is wrapped in its own .memory-message div so
MediaWiki:Common.js can measure and collapse long entries behind
a "Read More" toggle (see MediaWiki:Common.css for the collapsed
styling) without also catching the name/date header or the photo.
The tribute icon (when set) renders once, as its own left-column badge
block beside the name/date/message content (see
.memory-tribute-badge/.memory-content in
MediaWiki:Common.css) — not inline text next to the name.
Unset or unrecognized values render nothing at all (the #switch
default is empty, so no badge <div> is emitted and no
empty column appears), so every entry saved before this parameter existed
keeps rendering exactly as before.
One guestbook/memory entry, used via the "Add a Memory" flow on a memorial page.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Your name | name | How you'd like to be identified with your memory. | Line | required |
| Your memory or message | message | Share a story, memory, or message. | String | required |
| Tribute (optional) | tribute | A tribute icon shown as a badge beside your entry.
| String | optional |
| Photo (optional) | photo | An uploaded photo to include with your memory. | File | optional |
| Photo caption (optional) | caption | no description | Line | optional |
| Date (optional) | date | E.g. "September 2026" — leave blank if unsure. | Line | optional |