Editing
Help:Magic words
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Variables == Variables return information about the current page, wiki, or date. Their syntax is similar to [[Help:Templates|templates]]. Variables marked as "<span style="background:#FED;">'''[expensive]'''</span>" are tracked by the software, and the number that can be included on a page is limited. If a template name conflicts with a variable, the variable will be used (so to transclude the template [[{{ns:10}}:PAGENAME]] you would need to write <code><nowiki>{{</nowiki>{{ns:10}}:PAGENAME<nowiki>}}</nowiki></code>). In some cases, adding parameters will force the parser to invoke a template; for example, <code><nowiki>{{CURRENTDAYNAME|x}}</nowiki></code> transcludes [[{{ns:10}}:CURRENTDAYNAME]], ''not'' the variable. === Date and time === The following variables return the current date and time in UTC. Due to MediaWiki and browser caching, these variables frequently show when the page was ''cached'' rather than the current time. The date and time magic words are formatted in the wiki content language. Since {{r|94680|1.19}}, they depend on the [[page content language]]. {| class="wikitable" |- ! {{Hl2}}| Variable ! {{Hl2}}| Output ! {{Hl2}}| Description ! {{Hl2}}| Versions |- ! {{Hl3}} colspan="4"| '''Year''' |- | <code><nowiki>{{CURRENTYEAR}}</nowiki></code> | {{CURRENTYEAR}} | Year | |- ! {{Hl3}} colspan="4"| '''Month''' |- | <code><nowiki>{{CURRENTMONTH}}</nowiki></code> | {{CURRENTMONTH}} | Month (zero-padded number) | |- | <code><nowiki>{{CURRENTMONTHNAME}}</nowiki></code> | {{CURRENTMONTHNAME}} | Month (name) | |- | <code><nowiki>{{CURRENTMONTHNAMEGEN}}</nowiki></code> | {{CURRENTMONTHNAMEGEN}} | Month ([[wikipedia:genitive|genitive form]]) | |- | <code><nowiki>{{CURRENTMONTHABBREV}}</nowiki></code> | {{CURRENTMONTHABBREV}} | Month (abbreviation) | 1.5+ |- ! {{Hl3}} colspan="4"| '''Day''' |- | <code><nowiki>{{CURRENTDAY}}</nowiki></code> | {{CURRENTDAY}} | Day of the month (unpadded number) | |- | <code><nowiki>{{CURRENTDAY2}}</nowiki></code> | {{CURRENTDAY2}} | Day of the month (zero-padded number) | 1.6+ |- | <code><nowiki>{{CURRENTDOW}}</nowiki></code> | {{CURRENTDOW}} | Day of the week (unpadded number), 0 (for Sunday) through 6 (for Saturday) | |- | <code><nowiki>{{CURRENTDAYNAME}}</nowiki></code> | {{CURRENTDAYNAME}} | Day of the week (name) | |- ! {{Hl3}} colspan="4"| '''Time''' |- | <code><nowiki>{{CURRENTTIME}}</nowiki></code> | {{CURRENTTIME}} | Time (24-hour HH:mm format) | |- | <code><nowiki>{{CURRENTHOUR}}</nowiki></code> | {{CURRENTHOUR}} | Hour (24-hour zero-padded number) | |- ! {{Hl3}} colspan="4"| '''Other''' |- | <code><nowiki>{{CURRENTWEEK}}</nowiki></code> | {{CURRENTWEEK}} | Week (number) | |- | <code><nowiki>{{CURRENTTIMESTAMP}}</nowiki></code> | {{CURRENTTIMESTAMP}} | YYYYMMDDHHmmss timestamp | 1.7+ |} The following variables do the same as the above, but using the site's server config or $wgLocaltimezone. * <code><nowiki>{{LOCALYEAR}}</nowiki> * <nowiki>{{LOCALMONTH}}</nowiki> * <nowiki>{{LOCALMONTHNAME}}</nowiki> * <nowiki>{{LOCALMONTHNAMEGEN}}</nowiki> * <nowiki>{{LOCALMONTHABBREV}}</nowiki> * <nowiki>{{LOCALDAY}}</nowiki> * <nowiki>{{LOCALDAY2}}</nowiki> * <nowiki>{{LOCALDOW}}</nowiki> * <nowiki>{{LOCALDAYNAME}}</nowiki> * <nowiki>{{LOCALTIME}}</nowiki> * <nowiki>{{LOCALHOUR}}</nowiki> * <nowiki>{{LOCALWEEK}}</nowiki> * <nowiki>{{LOCALTIMESTAMP}}</nowiki></code> * ''For more thorough time formatting, you may want to install [[Extension:ParserFunctions]] to use the [[Help:Extension:ParserFunctions#.23time|#time parser function]]''. === Technical metadata === ''Note:'' Revision variables return data about the '''latest edit to the current page''', even if viewing an older version of the page. {| class="wikitable" |- ! {{Hl2}}| Variable ! {{Hl2}}| Output ! {{Hl2}}| Description ! {{Hl2}}| Versions |- ! {{Hl3}} colspan="4"| '''Site''' |- | <code><nowiki>{{SITENAME}}</nowiki></code> | {{SITENAME}} | The wiki's site name ({{mediawiki|Manual:$wgSitename|$wgSitename}}). | |- | <code><nowiki>{{SERVER}}</nowiki></code> | {{SERVER}} | Domain URL ({{mediawiki|Manual:$wgServer|$wgServer}}). | |- | <code><nowiki>{{SERVERNAME}}</nowiki></code> | {{SERVERNAME}} | Domain name (no longer dependent on {{mediawiki|Manual:$wgServerName|$wgServerName}} as of version 1.17). | |- | <code><nowiki>{{DIRMARK}}</nowiki></code> <br /><code><nowiki>{{DIRECTIONMARK}}</nowiki></code> | {{DIRMARK}} <br />{{DIRECTIONMARK}} | Outputs a unicode-directional mark that matches the wiki's default language's direction (<code>&lrm;</code> on left-to-right wikis, <code>&rlm;</code> on right-to-left wikis), useful in text with multi-directional text. Since {{r|94680|1.19}}, it depends on the [[page content language]]. | {{r|14442|1.7+}} |- | <code><nowiki>{{SCRIPTPATH}}</nowiki></code> | {{SCRIPTPATH}} | Relative script path ({{mediawiki|Manual:$wgScriptPath|$wgScriptPath}}). | |- | <code><nowiki>{{STYLEPATH}}</nowiki></code> | {{STYLEPATH}} | Relative style path ({{mediawiki|Manual:$wgStylePath|$wgStylePath}}). | 1.16+ |- | <code><nowiki>{{CURRENTVERSION}}</nowiki></code> | {{CURRENTVERSION}} | The wiki's MediaWiki version. | {{r|14199|1.7+}} |- | <code><nowiki>{{CONTENTLANGUAGE}}</nowiki></code> <br /><code><nowiki>{{CONTENTLANG}}</nowiki></code> | {{CONTENTLANGUAGE}} <br />{{CONTENTLANG}} | The wiki's default interface language ({{mediawiki|Manual:$wgLanguageCode|$wgLanguageCode}}). | {{r|14661|1.7+}} |- ! {{Hl3}} colspan="4"| '''Page''' |- | <code><nowiki>{{PAGEID}}</nowiki></code> | {{PAGEID}} | Returns the page identifier. | {{mediawiki|gerrit:9858|1.20+}} |-style="background:#FED;" | <code><nowiki>{{PAGESIZE:</nowiki>''page name''<nowiki>}}</nowiki></code> <br /><code><nowiki>{{PAGESIZE:</nowiki>''page name''<nowiki>|R}}</nowiki> | {{PAGESIZE:Help:Magic_words}} <br />{{PAGESIZE:Help:Magic_words|R}} | '''[Expensive]''' Returns the byte size of the specified page. Use "<code><nowiki>|R</nowiki></code>" to get raw (unformatted) numbers. | {{mediawiki|rev:33551|1.13+}} |- | <code><nowiki>{{PROTECTIONLEVEL:</nowiki>''action''<nowiki>}}</nowiki></code> | <!-- Leave this empty. --> | Outputs the protection level (e.g. "autoconfirmed", "sysop") for a given action (e.g. "edit", "move") on the current page or an empty string if not protected. | {{mediawiki|rev:45587|1.15+}} |- ! {{Hl3}} colspan="4"| '''Latest revision to current page''' |- | <code><nowiki>{{REVISIONID}}</nowiki></code> | {{REVISIONID}} | Unique revision ID. | 1.5+ |- | <code><nowiki>{{REVISIONDAY}}</nowiki></code> | {{REVISIONDAY}} | Day edit was made (unpadded number). | 1.8+ |- | <code><nowiki>{{REVISIONDAY2}}</nowiki></code> | {{REVISIONDAY2}} | Day edit was made (zero-padded number). | 1.8+ |- | <code><nowiki>{{REVISIONMONTH}}</nowiki></code> | {{REVISIONMONTH}} | Month edit was made (zero-padded number as of {{mediawiki|rev:66200|1.17+}}, unpadded number in prior versions). | 1.8+ |- | <code><nowiki>{{REVISIONMONTH1}}</nowiki></code> | {{REVISIONMONTH1}} | Month edit was made (unpadded number). | {{mediawiki|rev:66200|1.17+}} |- | <code><nowiki>{{REVISIONYEAR}}</nowiki></code> | {{REVISIONYEAR}} | Year edit was made. | 1.8+ |- | <code><nowiki>{{REVISIONTIMESTAMP}}</nowiki></code> | {{REVISIONTIMESTAMP}} | Timestamp as of time of edit. | 1.8+ |- | <code><nowiki>{{REVISIONUSER}}</nowiki></code> | {{REVISIONUSER}} | The username of the user who made the most recent edit to the page, or the current user when previewing an edit. | {{mediawiki|rev:48149|1.15+}} |- ! {{Hl3}} colspan="4"| '''Affects page content''' |- | <code><nowiki>{{DISPLAYTITLE:</nowiki>''title''<nowiki>}}</nowiki></code> | | Format the current page's title header. The value must be equivalent to the default title: only capitalization changes and replacing spaces with underscores are allowed (this can be changed with {{manual|$wgRestrictDisplayTitle}}). It can be disabled or enabled by {{mediawiki|Manual:$wgAllowDisplayTitle|$wgAllowDisplayTitle}}; disabled by default before 1.10+, enabled by default thereafter. | 1.7+ |- | <code><nowiki>{{DEFAULTSORT:</nowiki>''sortkey''<nowiki>}}</nowiki></code> <br /><code><nowiki>{{DEFAULTSORTKEY:</nowiki>''sortkey''<nowiki>}}</nowiki></code> <br /><code><nowiki>{{DEFAULTCATEGORYSORT:</nowiki>''sortkey''<nowiki>}}</nowiki></code> <br/><code><nowiki>{{DEFAULTSORT:</nowiki>''sortkey''<nowiki>|noerror}}</nowiki></code> <br/><code><nowiki>{{DEFAULTSORT:</nowiki>''sortkey''<nowiki>|noreplace}}</nowiki></code> | | Used for categorizing pages, sets a default [[Help:Categories|category sort key]]. For example if you put <code><nowiki>{{DEFAULTSORT:Smith, John}}</nowiki></code> at the end of [[John Smith]], the page would be sorted under "S" by default in categories. It can take a second argument of ''noerror'' or ''noreplace'' to suppress error messages when multiple defaultsortkeys are used on one page or to make it do nothing if multiple defaultsortkeys are used. | 1.10+ <br/>{{mediawiki|rev:96767|1.19+}} (for noerror and noreplace) |} === Statistics === 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, <code><nowiki>{{NUMBEROFPAGES}}</nowiki></code> → {{NUMBEROFPAGES}} and <code><nowiki>{{NUMBEROFPAGES:R}}</nowiki></code> → {{NUMBEROFPAGES:R}}). Use "|R" for magic words that require a parameter like PAGESINCATEGORY (for example <code><nowiki>{{PAGESINCATEGORY:Help}}</nowiki></code> and <code><nowiki>{{PAGESINCATEGORY:Help|R}}</nowiki></code>, or <code><nowiki>{{PAGESINCATEGORY:Help|subcats}}</nowiki></code> and <code><nowiki>{{PAGESINCATEGORY:Help|subcats|R}}</nowiki></code>). Also applicable to <code><nowiki>{{PAGESIZE:</nowiki>''page name''<nowiki>}}</nowiki></code> hereinbefore. The number magic words are formatted in the wiki content language. Since {{r|94680|1.19}}, it depends on the [[page content language]]. {| class="wikitable" |- ! {{Hl2}}| Variable ! {{Hl2}}| Output ! {{Hl2}}| Description ! {{Hl2}}| Versions |- ! {{Hl3}} colspan="4"| '''Entire wiki''' |- | <code><nowiki>{{NUMBEROFPAGES}}</nowiki></code> | {{NUMBEROFPAGES}} | Number of wiki pages. | 1.7+ |- | <code><nowiki>{{NUMBEROFARTICLES}}</nowiki></code> | {{NUMBEROFARTICLES}} | Number of pages in {{mediawiki|Manual:Using custom namespaces#Content namespaces|content namespaces}}. | |- | <code><nowiki>{{NUMBEROFFILES}}</nowiki></code> | {{NUMBEROFFILES}} | Number of uploaded files. | 1.5+ |- | <code><nowiki>{{NUMBEROFEDITS}}</nowiki></code> | {{NUMBEROFEDITS}} | Number of page edits. | {{mediawiki|rev:21319|1.10+}} |- | <code><nowiki>{{NUMBEROFVIEWS}}</nowiki></code> | {{NUMBEROFVIEWS}} | Number of page views. Usually useless on a wiki using [[Manual:Cache|caching]]. | {{mediawiki|rev:42721|1.14+}} |- | <code><nowiki>{{NUMBEROFUSERS}}</nowiki></code> | {{NUMBEROFUSERS}} | Number of registered users. | 1.7+ |- | <code><nowiki>{{NUMBEROFADMINS}}</nowiki></code> | {{NUMBEROFADMINS}} | Number of users in the ''sysop'' {{mediawiki|Manual:User rights|group}}. | 1.7+ |- | <code><nowiki>{{NUMBEROFACTIVEUSERS}}</nowiki></code> | {{NUMBEROFACTIVEUSERS}} | Number of active users, based on the criteria used in [[Special:Statistics]]. | {{mediawiki|rev:47392|1.15+}} |- style="background:#FED;" | <code><nowiki>{{PAGESINCATEGORY:</nowiki>''categoryname''<nowiki>}}</nowiki></code> <br /><code><nowiki>{{PAGESINCAT:</nowiki>''categoryname''<nowiki>}}</nowiki></code> | {{PAGESINCATEGORY:Help}} <br />{{PAGESINCAT:Help}} | '''[Expensive]''' Number of pages (including any subcategories and files) in the given [[Help:Categories|category]]. | {{mediawiki|rev:32932|1.13+}} |- style="background:#FED;" | <code><nowiki>{{PAGESINCATEGORY:</nowiki>''categoryname''<nowiki>|all}}</nowiki></code> <br /><code><nowiki>{{PAGESINCATEGORY:</nowiki>''categoryname''<nowiki>|pages}}</nowiki></code> <br /><code><nowiki>{{PAGESINCATEGORY:</nowiki>''categoryname''<nowiki>|subcats}}</nowiki></code> <br /><code><nowiki>{{PAGESINCATEGORY:</nowiki>''categoryname''<nowiki>|files}}</nowiki></code> | {{PAGESINCATEGORY:Help|all}} <br />{{PAGESINCATEGORY:Help|pages}} <br />{{PAGESINCATEGORY:Help|subcats}} <br />{{PAGESINCATEGORY:Help|files}} | '''[Expensive]''' Respectively, the number of * all pages * ordinary pages (excluding subcategories and files) * subcategories or * files in the given [[Help:Categories|category]]. | [//gerrit.wikimedia.org/r/#/c/12790/ 1.20+] |- | <code><nowiki>{{NUMBERINGROUP:</nowiki>''groupname''<nowiki>}}</nowiki></code> <br /><code><nowiki>{{NUMINGROUP:</nowiki>''groupname''<nowiki>}}</nowiki></code> | {{NUMBERINGROUP:bureaucrat}} <br />{{NUMINGROUP:bureaucrat}} <br /><small><nowiki>({{NUMBERINGROUP:bureaucrat}} used here)</nowiki></small> | Number of users in a specific {{mediawiki|Manual:User rights|group}}. | {{mediawiki|rev:40116|1.14+}} |- | <code><nowiki>{{PAGESINNS:</nowiki>''index''<nowiki>}}</nowiki></code> <br /><code><nowiki>{{PAGESINNAMESPACE:</nowiki>''index''<nowiki>}}</nowiki></code> | ''Not enabled'' | Number of pages in the given [[Help:Namespaces|namespace]] (replace ''index'' with the relevant [[Manual:Namespace|namespace index]]). For instance, <code><nowiki>{{PAGESINNAMESPACE:</nowiki>''14''<nowiki>}}</nowiki></code> will output the number of category pages. <code><nowiki>{{PAGESINNS:0}}</nowiki></code> differs from <code><nowiki>{{NUMBEROFARTICLES}}</nowiki></code> in that the former includes redirects and disambiguation pages. Disabled by default, enable with {{mediawiki|Manual:$wgAllowSlowParserFunctions|$wgAllowSlowParserFunctions}}. | 1.7+ |} ===Page names=== {| class="wikitable" |- ! {{Hl2}}| Variable ! {{Hl2}}| Output ! {{Hl2}}| Description ! {{Hl2}}| Versions |- | <code><nowiki>{{FULLPAGENAME}}</nowiki></code> | {{FULLPAGENAME}} | Namespace and page title. | 1.6+ |- | <code><nowiki>{{PAGENAME}}</nowiki></code> | {{PAGENAME}} | Page title. | |- | <code><nowiki>{{BASEPAGENAME}}</nowiki></code> | {{BASEPAGENAME}} | Page title excluding the current [[Help:Subpages|subpage]] and namespace ("Title/foo" on "Title/foo/bar"). For more complex splitting, use <code><nowiki>{{</nowiki>[[Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> from [[Help:Extension:ParserFunctions|ParserFunctions extension]]. | 1.7+ |- | <code><nowiki>{{SUBPAGENAME}}</nowiki></code> | {{SUBPAGENAME}} | The [[Help:Subpages|subpage]] title ("foo" on "Title/foo"). | 1.6+ |- | <code><nowiki>{{SUBJECTPAGENAME}}</nowiki></code> <br/><code><nowiki>{{ARTICLEPAGENAME}}</nowiki></code> | {{SUBJECTPAGENAME}}<br/>{{ARTICLEPAGENAME}} | The namespace and title of the associated subject page. | 1.7+ |- | <code><nowiki>{{TALKPAGENAME}}</nowiki></code> | {{TALKPAGENAME}} | The namespace and title of the associated talk page. | 1.7+ |} The <code><nowiki>{{BASEPAGENAME}}</nowiki></code> and <code><nowiki>{{SUBPAGENAME}}</nowiki></code> magic words only work in namespaces that have subpages enabled. See {{mediawiki|Manual:$wgNamespacesWithSubpages}} for information on enabling subpages. As of {{mediawiki|rev:46662|1.15+}}, these can all take a parameter, allowing specification of the page to be operated on, instead of just the current page: * <code><nowiki>{{PAGENAME:Template:Main Page}}</nowiki></code> → '''{{PAGENAME:Template:Main Page}}''' {{Warning|Page titles containing certain characters, such as single quotes (') or asterisks <code>*</code>, may produce unexpected results when handled with these magic words, e.g. <code><nowiki>{{PAGESINCATEGORY:{{PAGENAME}}}}</nowiki></code>. See bugs {{mediawiki|bugzilla:14779|14779}}, {{mediawiki|bugzilla:16474|16474}} and {{mediawiki|bugzilla:35628|35628}}.}} For example, if page name is "L'Aquila", the following code will produce the string "Numeric char encoding": <pre><nowiki>{{#switch:{{PAGENAME}} | L'Aquila = No translation | L = not ok | L&apos;Aquila = Entity escaping | L&#39;Aquila = Numeric char encoding }}</nowiki></pre> ==== URL encoded page names ==== The following are equivalents encoded for use in MediaWiki URLs (i.e. spaces replaced with underscores and some characters [[wikipedia:Numeric character reference|HTML escaped using numeric character encoding]]): * <code><nowiki>{{FULLPAGENAMEE}}</nowiki> * <nowiki>{{PAGENAMEE}}</nowiki> * <nowiki>{{BASEPAGENAMEE}}</nowiki> * <nowiki>{{SUBPAGENAMEE}}</nowiki> * <nowiki>{{SUBJECTPAGENAMEE}}</nowiki> * <nowiki>{{ARTICLEPAGENAMEE}}</nowiki> * <nowiki>{{TALKPAGENAMEE}}</nowiki></code> Note that <code><nowiki>{{PAGENAME}}</nowiki></code>, <code><nowiki>{{PAGENAMEE}}</nowiki></code> and <code><nowiki>{{urlencode:}}</nowiki></code> have distinct implementations. See [[Manual:PAGENAMEE encoding]] for details. === Namespaces === {| class="wikitable" |- ! {{Hl2}}| Variable ! {{Hl2}}| Output ! {{Hl2}}| Description ! {{Hl2}}| Versions |- | <code><nowiki>{{NAMESPACE}}</nowiki></code> | {{NAMESPACE}} | Name of the page's namespace | |- | <code><nowiki>{{NAMESPACENUMBER}}</nowiki></code> | {{NAMESPACENUMBER}} | ID of the page's namespace | [[gerrit:4056|1.20+]] |- | <code><nowiki>{{SUBJECTSPACE}}</nowiki></code> <br /><code><nowiki>{{ARTICLESPACE}}</nowiki></code> | {{SUBJECTSPACE}} <br />{{ARTICLESPACE}} | Name of the associated content namespace | 1.7+ |- | <code><nowiki>{{TALKSPACE}}</nowiki></code> | {{TALKSPACE}} | Name of the associated talk namespace | 1.7+ |} The following are equivalents encoded for use in MediaWiki URLs (spaces replaced with underscores and some characters percent-encoded): * <code><nowiki>{{NAMESPACEE}}</nowiki> * <nowiki>{{SUBJECTSPACEE}}</nowiki> * <nowiki>{{TALKSPACEE}}</nowiki></code> As of {{mediawiki|rev:46630|1.15+}}, these can take a full-page-name parameter and will return the requested namespace associated with that page, instead of with the current page: * <code><nowiki>{{NAMESPACE:Template:Main Page}}</nowiki></code> → '''{{NAMESPACE:Template:Main Page}}''' * <code><nowiki>{{SUBJECTSPACE:Template:Main Page}}</nowiki></code> → '''{{SUBJECTSPACE:Template:Main Page}}''' * <code><nowiki>{{TALKSPACE:Template:Main Page}}</nowiki></code> → '''{{TALKSPACE:Template:Main Page}}''' Parameter must not be a namespace name: * <code><nowiki>{{SUBJECTSPACE:Help talk}}</nowiki></code> → '''{{SUBJECTSPACE:Help talk}}'''
Summary:
Please note that all contributions to Fanra's EverQuest Wiki are considered to be released under the Creative Commons Attribution Share Alike (see
Project:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Help page
Discussion
English
Views
Read
Edit source
View history
More
Search
Main Menu
Main page
Sections
Classes and Races
Spells, Songs, Disciplines, and AAs
Items
Zones
NPCs
Quests
Raids
Tradeskills
User Interface
Tips and Guides
EQ Links
Wiki
Recent changes
Advanced search
Random page
Help
Contact Fanra
Tools
What links here
Related changes
Upload file
Special pages
Page information