Template:Infobox rank: Difference between revisions
More actions
m Enlarge title icon and widen gap from title text |
m Use renamed Template:Navbox ranks |
||
| Line 3: | Line 3: | ||
|image={{{image|}}} | |image={{{image|}}} | ||
|type={{#if:{{{staff|}}}|{{#ifeq:{{lc:{{{staff|}}}}}|yes|Staff Rank|Community Rank}}}} | |type={{#if:{{{staff|}}}|{{#ifeq:{{lc:{{{staff|}}}}}|yes|Staff Rank|Community Rank}}}} | ||
|content={{#if:{{{staff|}}}|<div class="loka-infobox-row"><span class="loka-infobox-row-key">Staff</span><span class="loka-infobox-row-value"><span class="loka-rank-staff loka-rank-staff--{{lc:{{{staff|}}}}}">{{{staff|}}}</span></span></div>}}{{#ifeq:{{lc:{{{staff|}}}}}|yes|<div class="loka-infobox-row"><span class="loka-infobox-row-key">Current holders</span><span class="loka-infobox-row-value">{{#if:{{{current|}}}|{{{current|}}}|[[:Category:{{{name|{{PAGENAME}}}}} holders|{{PAGESINCATEGORY:{{{name|{{PAGENAME}}}}} holders}}]]}}</span></div>}}{{#if:{{{purpose|}}}|<div class="loka-infobox-row"><span class="loka-infobox-row-key">Purpose</span><span class="loka-infobox-row-value">{{{purpose|}}}</span></div>}}{{#if:{{{forumid|{{{forumId|}}}}}}|<div class="loka-infobox-row"><span class="loka-infobox-row-key">Forum post</span><span class="loka-infobox-row-value">{{Forums|id={{{forumid|{{{forumId|}}}}}}|on=no}}</span></div>}}{{#if:{{{active|}}}|<div class="loka-infobox-row"><span class="loka-infobox-row-key">Active</span><span class="loka-infobox-row-value"><span class="loka-rank-active loka-rank-active--{{lc:{{{active|}}}}}">{{{active|}}}</span></span></div>}}{{ | |content={{#if:{{{staff|}}}|<div class="loka-infobox-row"><span class="loka-infobox-row-key">Staff</span><span class="loka-infobox-row-value"><span class="loka-rank-staff loka-rank-staff--{{lc:{{{staff|}}}}}">{{{staff|}}}</span></span></div>}}{{#ifeq:{{lc:{{{staff|}}}}}|yes|<div class="loka-infobox-row"><span class="loka-infobox-row-key">Current holders</span><span class="loka-infobox-row-value">{{#if:{{{current|}}}|{{{current|}}}|[[:Category:{{{name|{{PAGENAME}}}}} holders|{{PAGESINCATEGORY:{{{name|{{PAGENAME}}}}} holders}}]]}}</span></div>}}{{#if:{{{purpose|}}}|<div class="loka-infobox-row"><span class="loka-infobox-row-key">Purpose</span><span class="loka-infobox-row-value">{{{purpose|}}}</span></div>}}{{#if:{{{forumid|{{{forumId|}}}}}}|<div class="loka-infobox-row"><span class="loka-infobox-row-key">Forum post</span><span class="loka-infobox-row-value">{{Forums|id={{{forumid|{{{forumId|}}}}}}|on=no}}</span></div>}}{{#if:{{{active|}}}|<div class="loka-infobox-row"><span class="loka-infobox-row-key">Active</span><span class="loka-infobox-row-value"><span class="loka-rank-active loka-rank-active--{{lc:{{{active|}}}}}">{{{active|}}}</span></span></div>}}{{Navbox ranks}} | ||
}}[[Category:Ranks]]{{#ifeq:{{lc:{{{staff|}}}}}|yes|[[Category:Staff ranks]]}}</includeonly><noinclude> | }}[[Category:Ranks]]{{#ifeq:{{lc:{{{staff|}}}}}|yes|[[Category:Staff ranks]]}}</includeonly><noinclude> | ||
== Usage == | == Usage == | ||
Revision as of 10:00, 22 August 2026
Usage
{{Infobox rank
|name=Sentry
|purpose=Chat Moderator
|staff=Yes
|forumid=79
|active=Active
}}
Only name is required (it otherwise defaults to the page name); every other row is hidden when omitted. Built on Template:Infobox for the shared name/image/row chrome -- see there for the wiki's common infobox look. For a rank's own article (e.g. Sentry); article prose (how to obtain it, conduct expectations) belongs below the infobox as normal. Not the same thing as Template:Rank (an inline colour badge for mentioning a rank in running prose, e.g. on a player's own infobox) or Template:Icon's unrelated PvP-tier "Rank" icon family. Automatically adds the page to Category:Ranks, and to Category:Staff ranks as well when staff=Yes. Template:Ranks navbox is included automatically at the bottom of every infobox -- no parameter for it, and no need to add it separately.
Parameters
| Parameter | Description |
|---|---|
name
|
Rank name. Defaults to the page name. Also drives the infobox title's colour -- see below. |
titleicon
|
Optional wikitext (usually an {{Icon|...}} call) appended after the coloured title, for a rank closely tied to a specific icon (e.g. Community Representative). Left unset, nothing is appended.
|
image
|
Filename of a badge/icon image uploaded to the wiki (no File: prefix).
|
purpose
|
Short description shown as its own row (e.g. Chat Moderator, Sub-admin).
|
staff
|
Yes or No -- shown as a green/red badge. Also sets the ribbon under the name ("Staff Rank" / "Community Rank"), gates whether the Current holders row appears at all (see below), and whether this page is added to Category:Staff ranks. The ribbon and Staff row are both hidden if left unset entirely, rather than guessing.
|
current
|
Manual override for Current holders (only shown when staff=Yes), for the rare case the automatic count (see below) is temporarily wrong or not yet populated. Leave unset to use the real count.
|
forumid
|
Numerical ID from this rank's forum thread URL, e.g. 79 for https://forums.lokamc.com/threads/sentry-rank.79/. Passed straight through Template:Forums (with its "on the Loka Forums" suffix suppressed -- this row's own "Forum post" label already says what it is). forumId also works.
|
active
|
Current status -- Active or Deprecated are colour-coded (green/red); other values still display, just uncoloured. For a rank no longer in use, pair this with Template:Deprecated at the top of the article rather than relying on this field alone (see Slicer).
|
The title's colour comes from Template:Rank
There's no colour parameter. The infobox title is literally {{Rank|name}} -- the same colour, bold/plain weight, tooltip, and light/dark variants Template:Rank already gives that name anywhere else it's used (e.g. on a player's own infobox). One rank has one colour, defined in exactly one place, rather than a second hex code here that could say something different. A name Template:Rank doesn't recognise just displays as plain text -- add it there first if it needs a colour.
Current holders is automatic
The Current holders count is not a number to type in and keep updated by hand -- it reads live off Template:Infobox player. Every player's own infobox sets their own rank=, which silently adds that page to a "<rank> holders" category; this template counts that category with 0 and links the number straight to it, so clicking the count shows exactly who's counted. There's exactly one place a player's rank is ever recorded -- their own page -- so this can't drift out of sync the way a hand-maintained roster number would. If the count looks wrong, the fix is updating the player's own infobox, not this one.