Template:GuestbookWidget: Difference between revisions
m 1 revision imported |
Replace VisualEditor entry link with the new custom single-form Guestbook widget |
||
| Line 4: | Line 4: | ||
}} | }} | ||
<div class="guestbook-form-widget" data-guestbook-subpage="{{FULLPAGENAME}}/Guestbook"></div> | |||
<noinclude> | <noinclude> | ||
Drop <code><nowiki>{{GuestbookWidget}}</nowiki></code> into any memorial page's | Drop <code><nowiki>{{GuestbookWidget}}</nowiki></code> into any memorial page's | ||
Guestbook section. It works on whichever page it's placed on — no page name to | Guestbook section. It works on whichever page it's placed on — no page name to | ||
fill in — by transcluding "<This page>/Guestbook" and linking to a | fill in — by transcluding "<This page>/Guestbook" and rendering a native | ||
VisualEditor edit | submission form (built by <code>MediaWiki:Common.js</code>) instead of linking | ||
out to a VisualEditor edit. | |||
Important: do NOT pre-create the "PersonName/Guestbook" subpage | Important: do NOT pre-create the "PersonName/Guestbook" subpage — leave it to | ||
be created by the first real submission. The {{#ifexist:}} above shows a | |||
friendly placeholder instead of a redlink until then. | |||
{{#ifexist:}} above shows a friendly placeholder instead of a redlink until | |||
The | The visible form (name / message / a tribute-icon row / photo upload / submit) | ||
is rendered client-side by <code>MediaWiki:Common.js</code> into the empty | |||
<code>.guestbook-form-widget</code> div above, and submits via the Action API | |||
(<code>action=edit</code>, <code>appendtext</code>) directly onto this page's | |||
"/Guestbook" subpage as a <code>{{Memory|...}}</code> entry — the same storage | |||
format the old VisualEditor-based flow used, so this only changes how entries | |||
are submitted, not how they're stored or rendered. | |||
Posting requires being logged in — logged-out visitors see a "log in or | |||
create an account" prompt instead of the form fields. | |||
</noinclude> | </noinclude> | ||
Revision as of 06:33, 14 September 2026
Be the first to share a memory.
Drop {{GuestbookWidget}} into any memorial page's
Guestbook section. It works on whichever page it's placed on — no page name to
fill in — by transcluding "<This page>/Guestbook" and rendering a native
submission form (built by MediaWiki:Common.js) instead of linking
out to a VisualEditor edit.
Important: do NOT pre-create the "PersonName/Guestbook" subpage — leave it to be created by the first real submission. The above shows a friendly placeholder instead of a redlink until then.
The visible form (name / message / a tribute-icon row / photo upload / submit)
is rendered client-side by MediaWiki:Common.js into the empty
.guestbook-form-widget div above, and submits via the Action API
(action=edit, appendtext) directly onto this page's
"/Guestbook" subpage as a
A Visitor
entry — the same storage
format the old VisualEditor-based flow used, so this only changes how entries
are submitted, not how they're stored or rendered.
Posting requires being logged in — logged-out visitors see a "log in or create an account" prompt instead of the form fields.