Template:Infobox/Doc: Difference between revisions
From questden
Jump to navigationJump to search
(Document category behaviour.) |
m (Need to suppress categorisation to prevent Infobox showing up on Category:Quests due to example.) |
||
Line 2: | Line 2: | ||
<noinclude>:'''This is a template documentation page.''' It is transcluded into place.</noinclude> | <noinclude>:'''This is a template documentation page.''' It is transcluded into place.</noinclude> | ||
= Purpose = | = Purpose = | ||
{{User:LionsPhil/InfoboxProto|author=LionsPhil|thread1=0}} | {{User:LionsPhil/InfoboxProto|author=LionsPhil|thread1=0|suppresscat=1}} | ||
This is the template for making a neat infobox for a quest, as shown on the right. Put it at the top of quest pages. It automatically adds the page to [[:Category:Quests]], and will add [[:Template:Noauthor]] if appropriate. You'll still need to list [[:Category:Running Quests]] and [[:Category:Image Quests]] as appropriate. | This is the template for making a neat infobox for a quest, as shown on the right. Put it at the top of quest pages. It automatically adds the page to [[:Category:Quests]], and will add [[:Template:Noauthor]] if appropriate. You'll still need to list [[:Category:Running Quests]] and [[:Category:Image Quests]] as appropriate. | ||
= Usage = | = Usage = | ||
Line 19: | Line 19: | ||
;specthreadNboard:Board for corresponding 'special' thread; defaults to <code>quest</code>. | ;specthreadNboard:Board for corresponding 'special' thread; defaults to <code>quest</code>. | ||
;specthreadNname:Name for corresponding special thread. | ;specthreadNname:Name for corresponding special thread. | ||
== Other == | |||
;suppresscat:Set this to something non-blank to prevent automatic categorisation. You probably don't want to use this. | |||
== Example == | == Example == | ||
A quick reminder of MediaWiki template syntax; whitespace is reasonably flexible either side of the pipes, so do whatever is most readable: | A quick reminder of MediaWiki template syntax; whitespace is reasonably flexible either side of the pipes, so do whatever is most readable: |
Revision as of 07:15, 12 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.
- This is a template documentation page. It is transcluded into place.
Purpose
Infobox/Doc by LionsPhil |
---|
|
This is the template for making a neat infobox for a quest, as shown on the right. Put it at the top of quest pages. It automatically adds the page to Category:Quests, and will add Template:Noauthor if appropriate. You'll still need to list Category:Running Quests and Category:Image Quests as appropriate.
Usage
Parameters (all are optional, although at least author is expected):
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.
Other
- suppresscat
- Set this to something non-blank to prevent automatic categorisation. You probably don't want to use this.
Example
A quick reminder of MediaWiki template syntax; whitespace is reasonably flexible either side of the pipes, so do whatever is most readable:
{{InfoboxQuest|author=TestPattern|image=tozol_title.png |thread1=79880|thread2=94645 |disthread1=316424 |specthread1=156238|specthread1name=April Fool's Edition }}
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 the 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.