Difference between revisions of "Template:Infobox/Doc"

From questden
(Move documentation into separate node and expand to intent.)
 
(Maintenance notes, let example default-case more things; drop explicit ranges for readability.)
Line 1: Line 1:
 
:'''This page is a user-namespaced test.''' Please don't use it on real pages; it's intended to be moved into place when it's ready.
 
:'''This page is a user-namespaced test.''' Please don't use it on real pages; it's intended to be moved into place when it's ready.
 
= Purpose =
 
= Purpose =
{{User:LionsPhil/InfoboxProto|author=LionsPhil|image=no_quest_image.svg|thread1=0}}
+
{{User:LionsPhil/InfoboxProto|author=LionsPhil|thread1=0}}
 
This is the template for making a neat infobox for a quest. Docs will follow.
 
This is the template for making a neat infobox for a quest. Docs will follow.
 
= Usage =
 
= Usage =
Line 10: Line 10:
 
;image:Quest image, without namespace. Will be thumbnailed to fit.
 
;image:Quest image, without namespace. Will be thumbnailed to fit.
 
== Threads ==
 
== Threads ==
;thread1…threadN:Post numbers for the threads of the quest.
+
All thread parameters must be numbered, starting from 1. For example, <code><nowiki>thread1=500|thread2=600&hellip;</nowiki></code>.
;disthread1&hellip;disthreadN:Post numbers for discussion threads.
+
;threadN:Post numbers for the threads of the quest.
== Special threads ==
+
;disthreadN:Post numbers for discussion threads.
 +
=== Specials ===
 
For example, 'April Fool' versions of quests.
 
For example, 'April Fool' versions of quests.
;specthread1&hellip;specthreadN:Post numbers for any 'special' threads.
+
;specthreadN:Post numbers for any 'special' threads.
;specthread1board&hellip;specthreadNboard:Board for corresponding 'special' thread; defaults to <code>quest</code>.
+
;specthreadNboard:Board for corresponding 'special' thread; defaults to <code>quest</code>.
;specthread1name&hellip;specthreadNname:Name for corresponding special thread.
+
;specthreadNname:Name for corresponding special thread.
 
== Example ==
 
== Example ==
 
A quick reminder of MediaWiki template syntax:
 
A quick reminder of MediaWiki template syntax:
Line 22: Line 23:
 
= Maintenance notes =
 
= Maintenance notes =
 
* Depends on the automatic redirect from <code>/quest/</code> to <code>/questarch/</code> for archived threads (semantically, the <code>/quest/</code> version is considered its canonical URI). This allows the "current thread" to work without having to be flagged as special in any way.
 
* Depends on the automatic redirect from <code>/quest/</code> to <code>/questarch/</code> for archived threads (semantically, the <code>/quest/</code> version is considered its canonical URI). This allows the "current thread" to work without having to be flagged as special in any way.
 +
* Depends on [[http://www.mediawiki.org/wiki/Help:Extension:ParserFunctions ParserFunctions extension]] to support optional parameters gracefully. This makes the code pretty hairy, so take care editing.
 +
* The maximum number of threads is limited by the implementation repeating the definition for each number. Unfortunately this is a common MediaWiki paradigm as it has no set handling in templates.

Revision as of 22:56, 11 July 2010

This page is a user-namespaced test. Please don't use it on real pages; it's intended to be moved into place when it's ready.

Purpose

Infobox/Doc by LionsPhil
0.png

This is the template for making a neat infobox for a quest. Docs will follow.

Usage

Parameters (all are optional):

Metadata

title
Title of the quest. Defaults to the current page name; normally you should leave it to do this.
author
Quest author; will be linked to as a wiki node, even if it has whitespace.
image
Quest image, without namespace. Will be thumbnailed to fit.

Threads

All thread parameters must be numbered, starting from 1. For example, thread1=500|thread2=600….

threadN
Post numbers for the threads of the quest.
disthreadN
Post numbers for discussion threads.

Specials

For example, 'April Fool' versions of quests.

specthreadN
Post numbers for any 'special' threads.
specthreadNboard
Board for corresponding 'special' thread; defaults to quest.
specthreadNname
Name for corresponding special thread.

Example

A quick reminder of MediaWiki template syntax:

{{InfoboxQuest|author=TestPattern|image=tozol_title.png|thread1=79880|disthread1=316424}}

Maintenance notes

  • Depends on the automatic redirect from /quest/ to /questarch/ for archived threads (semantically, the /quest/ version is considered its canonical URI). This allows the "current thread" to work without having to be flagged as special in any way.
  • Depends on [ParserFunctions extension] to support optional parameters gracefully. This makes the code pretty hairy, so take care editing.
  • The maximum number of threads is limited by the implementation repeating the definition for each number. Unfortunately this is a common MediaWiki paradigm as it has no set handling in templates.