Jump to content

Template:TributeWidget: Difference between revisions

From LovedForever
Add Template:TributeWidget for the Leave a Tribute widget (Request 8)
 
Left a tribute (flower)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<div class="tribute-form-widget" data-tribute-page="{{FULLPAGENAME}}"></div>
<div class="tribute-form-widget" data-tribute-page="{{FULLPAGENAME}}"></div>
<noinclude>
<noinclude>
Drop <code><nowiki>{{TributeWidget}}</nowiki></code> at the <strong>bottom</strong> of a
Drop <code><nowiki>{{Tribute
|type=flower
|text=test
|name=Editor-in-Chief
|date=17 October 2026, 2:08 PM
}}
----
{{Tribute
|type=flower
|text=TEST
|name=Editor-in-Chief
|date=16 October 2026, 9:04 PM
}}
----
{{TributeWidget}}</nowiki></code> at the <strong>bottom</strong> of a
memorial's own "About" page (its main, top-level article -- not the "/Stories"
memorial's own "About" page (its main, top-level article -- not the "/Stories"
subpage), below the biography content. It renders a native submission form
subpage), below the biography content. It renders a native submission form

Latest revision as of 14:08, 17 October 2026

Drop {{Tribute |type=flower |text=test |name=Editor-in-Chief |date=17 October 2026, 2:08 PM }} ---- {{Tribute |type=flower |text=TEST |name=Editor-in-Chief |date=16 October 2026, 9:04 PM }} ---- {{TributeWidget}} at the bottom of a memorial's own "About" page (its main, top-level article -- not the "/Stories" subpage), below the biography content. It renders a native submission form (built by MediaWiki:Common.js, entirely separate code from the Stories widget's) offering three tribute types -- Lay a Flower, Light a Candle, Leave a Note -- plus a text box and Publish button. New submissions post onto *this* page as {{Tribute|...}} entries, inserted directly above this transclusion, the same "stays pinned at the bottom" pattern used by {{GuestbookWidget}} on the Stories subpage.

This widget and {{GuestbookWidget}} are architecturally independent: separate templates, separate JS submission handlers, separate entry data ({{Tribute|...}} vs {{Memory|...}}). They happen to render on different pages of the same memorial (this one on the About page, Stories' on the /Stories subpage) and share some visual CSS patterns, but neither reads or writes the other's data.

Auto-added to every brand-new top-level main-namespace page via the second EditFormPreloadText hook in LocalSettings.php (the one added alongside the Stories one, restricted to titles with no "/" at all). Existing pages created before this feature need this template call added manually, same one-time backfill Stories itself required.

Posting is open to anyone, logged in or not, matching the Stories widget's anonymous-posting policy. The poster's name is wgUserName when logged in, or "A Visitor" (the same default {{{name|A Visitor}}} already used by {{Memory|...}}) when anonymous -- there's no free-text name field on this form, unlike Stories.