Jump to content

Template:Memory: Difference between revisions

From LovedForever
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}}}'''{{#switch:{{{tribute|}}}|flowers= <span class="memory-tribute-icon" title="Flowers">💐</span>|fruits= <span class="memory-tribute-icon" title="Fruits">🍎</span>|car= <span class="memory-tribute-icon" title="Car">🚗</span>|house= <span class="memory-tribute-icon" title="House">🏠</span>|money= <span class="memory-tribute-icon" title="Money">💰</span>|#default=}}{{#if:{{{date|}}}| <span class="memory-date">— {{{date}}}</span>}}
'''{{{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, right after the name — not
The tribute icon (when set) renders once, as its own left-column badge
repeated, and not between the name and the message. Unset or unrecognized
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>&lt;div&gt;</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 small tribute icon shown next to your name.",
"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.

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
Your namename

How you'd like to be identified with your memory.

Linerequired
Your memory or messagemessage

Share a story, memory, or message.

Stringrequired
Tribute (optional)tribute

A tribute icon shown as a badge beside your entry.

Suggested values
flowers fruits car house money
Stringoptional
Photo (optional)photo

An uploaded photo to include with your memory.

Fileoptional
Photo caption (optional)caption

no description

Lineoptional
Date (optional)date

E.g. "September 2026" — leave blank if unsure.

Lineoptional