| Navigation: RuneScape Wiki >> Community Hub >> How To Edit The Wiki >> Editing Magic Words |
Magic words are strings of text that the wiki associates with a return value or function, such as time, site details, or page names.
There are three general types of magic words:
{{FOO}}. As such, they look a lot like templates.{{foo:...}} or {{#foo:...}}. See also Editing Parser Functions.Page-dependent magic words will affect or return data about the current page (by default), even if the word is added through a transcluded template.
A behavior switch controls the layout or behaviour of the page.
| Word | Description |
|---|---|
__NOTOC__ |
Hides the table of contents. |
__FORCETOC__ |
Forces the table of content to appear at its normal position (above the first header). |
__TOC__ |
Places a table of contents at the word's current position (overriding __NOTOC__). If this is used multiple times, the table of contents will appear at the first word's position. |
__NOEDITSECTION__ |
Hides the section edit links beside headings. |
Variables return information about the current page, wiki, or date. Their syntax is similar to templates.
The following variables return the current date and time in UTC.
Due to the wiki and browser caching, these variables frequently show when the page was cached rather than the current time.
| Variable | Output | Description |
|---|---|---|
{{CURRENTYEAR}} |
2013 | Year |
{{CURRENTMONTH}} |
05 | Month (zero-padded number) |
{{CURRENTMONTHNAME}} |
May | Month (name) |
{{CURRENTMONTHABBREV}} |
May | Month (abbreviation) |
{{CURRENTDAY}} |
23 | Day of the month (unpadded number) |
{{CURRENTDAY2}} |
23 | Day of the month (zero-padded number) |
{{CURRENTDOW}} |
4 | Day of the week (unpadded number) |
{{CURRENTDAYNAME}} |
Thursday | Day of the week (name) |
{{CURRENTTIME}} |
11:08 | Time (24-hour HH:mm format) |
{{CURRENTHOUR}} |
11 | Hour (24-hour zero-padded number) |
{{CURRENTWEEK}} |
21 | Week (number) |
{{CURRENTTIMESTAMP}} |
20130523110846 | YYYYMMDDHHmmss timestamp |
The following variables do the same as the above, but using the site's local timezone instead of user preferences and UTC:
{{LOCALYEAR}}{{LOCALMONTH}}{{LOCALMONTHNAME}}{{LOCALMONTHABBREV}}{{LOCALDAY}}{{LOCALDAY2}}{{LOCALDOW}}{{LOCALDAYNAME}}{{LOCALTIME}}{{LOCALHOUR}}{{LOCALWEEK}}{{LOCALTIMESTAMP}}Numbers returned by these variables normally contain separators (commas or spaces, depending on the local language), but can return raw numbers with the ":R" flag (for example, {{NUMBEROFPAGES}} → 46,188 and {{NUMBEROFPAGES:R}} → 46188).
| Variable | Output | Description |
|---|---|---|
{{NUMBEROFPAGES}} |
46,188 | Number of wiki pages. |
{{NUMBEROFARTICLES}} |
16,874 | Number of pages in the main namespace that aren't redirects and have at least one internal link. |
{{NUMBEROFFILES}} |
27,838 | Number of uploaded files. |
{{NUMBEROFUSERS}} |
2,114,243 | Number of registered users. |
| Variable | Output | Description |
|---|---|---|
{{FULLPAGENAME}} |
Editing Magic Words | Namespace and page title. |
{{PAGENAME}} |
Editing Magic Words | Page title. |
{{TALKPAGENAME}} |
Comments:Editing Magic Words | The namespace and title of the associated talk page. |
{{SUBPAGENAME}} |
Editing Magic Words | The name of the lowest level subpage of the current page (Eg: On "Foo/Bar" this would return "Bar"). |
The following are equivalents encoded for use in wiki URLs (spaces replaced with underscores and some characters percent-encoded):
{{FULLPAGENAMEE}}{{PAGENAMEE}}{{TALKPAGENAMEE}}{{SUBPAGENAMEE}}| Variable | Output | Description |
|---|---|---|
{{NAMESPACE}} |
Name of the page's namespace | |
{{TALKSPACE}} |
Comments | Name of the associated talk namespace |
The following are equivalents encoded for use in wiki URLs (spaces replaced with underscores and some characters percent-encoded):
{{NAMESPACEE}}{{TALKSPACEE}}Parser functions are very similar to variables, but take one or more parameters (technically, any magic word that takes a parameter is a parser function), and the name is sometimes prefixed with a hash to distinguish them from templates.
Additional parser functions are documented at Editing Parser Functions.
| Parser function | Example | Description |
|---|---|---|
{{urlencode:string}} |
{{urlencode:x y z á é}} → x+y+z+%C3%A1+%C3%A9 |
String encoded for use in URLs. Note that there is no urldecode function. |
{{anchorencode:string}} |
{{anchorencode:x y z á é}} → x_y_z_%C3%A1_%C3%A9 |
String encoded for use in URL section anchors (after the '#' symbol in a URL). |
| Usage | Example | Description |
|---|---|---|
{{lc:string}} |
{{lc:RUNESCAPE}} → runescape |
Input made lowercase. |
{{lcfirst:string}} |
{{lcfirst:RUNESCAPE}} → rUNESCAPE |
Input with the very first character lowercase. |
{{uc:string}} |
{{uc:runescape}} → RUNESCAPE |
Input made uppercase. |
{{ucfirst:string}} |
{{ucfirst:runescape}} → Runescape |
Input with the very first character uppercase. |
| How To Edit The Wiki | ||||||
|
||||||
|
||||||
|
||||||