Help:Magic Words

From Ask Dr Wiki

Jump to: navigation, search

This is an organised index of all Magic words that are known to work on this wiki. "XYZ" indicates user input, which is used in the example.

Contents

Table of contents

Word Explanation
__NOTOC__ Hides the Table of Contents on the current page.
__FORCETOC__ Forces the table of contents to appear.
__TOC__ Places a Table of Contents here. Also forces it to appear.

More magic

Word Explanation
__NOEDITSECTION__ Hides the edit links beside headings.
__NOTITLECONVERT__
__NOTC__
Like __NOCC__ but affecting article title only.
__END__ Allows for trailing whitespace to be included in the page save.

Template modifiers

Word Usage Explanation
{{subst:}} {{subst:XYZ}} Substitutes the template call with the content of the template.
{{msg:}} {{msg:XYZ}} If a template clashes with a magic word, use of the msg: modifier will use the template instead of the magic word. Otherwise, the magic word is used.
{{msgnw:}} {{msgnw:XYZ}} The template message is pasted as unevaluated <nowiki> text.
{{INT:}} {{INT:XYZ}} If a template clashes with a MediaWiki:message, use of the INT: modifier will use the message instead of the template. Otherwise, the template is used.

Time

Word Example Explanation
{{CURRENTDAY}} 29 Displays the current day in numeric form.
{{CURRENTDAYNAME}} Tuesday Displays the current day in named form.
{{CURRENTDOW}} 2 Displays the current day as a number of the week (0=Sunday, 1=Monday...).
{{CURRENTMONTH}} 07 Displays the current month in numeric form.
{{CURRENTMONTHABBREV}} Jul Displays the abbreviation of the current month.
{{CURRENTMONTHNAME}} July Displays the current month in named form.
{{CURRENTMONTHNAMEGEN}} July Displays the name of the current month in genitive form. Wikis that don't support this will default to {{CURRENTMONTHNAME}}.
{{CURRENTTIME}} 18:48 Displays the current time of day (hours:minutes).
{{CURRENTWEEK}} 31 Displays the number of the current week (1-52).
{{CURRENTYEAR}} 2014 Returns the current year.

Page names, locations, and URLs

Word Example Explanation
{{PAGENAME}} Magic Words Returns the name of the current page, including all levels (Title/Subtitle/Sub-subtitle).
{{PAGENAMEE}} Magic_Words More URL-friendly percent encoded special characters (rarely necessary).
{{NAMESPACE}} Help Returns the name of the namespace the current page resides in.
{{REVISIONID}} 2241 Gives you the unique identifying number of the article or diff database.
{{SITENAME}} Ask Dr Wiki Returns the name of the wiki (set in LocalSettings.php).
{{NS:}} {{NS:4}} = Ask_Dr_Wiki
{{NS:PROJECT}} = Ask_Dr_Wiki
Returns the name of a given namespace number.
{{LOCALURL:x y}}
{{LOCALURLE:%}}
/mediawiki/index.php?title=X_y
/mediawiki/index.php?title=%25
Returns the local URL of a given page. The page might not exist.
{{SERVER}} http://www.askdrwiki.com Returns the domain and subdomain URL of the wiki.
{{SCRIPTPATH}} /mediawiki Returns the value of $wgScriptPath in LocalSettings.php.
{{SERVERNAME}} www.askdrwiki.com Returns the value of $wgServerName in LocalSettings.php.

Miscellaneous

Word Usage Explanation
{{NUMBEROFARTICLES}} 1,408 A variable which returns the total number of articles on the Wiki.
{{NUMBEROFFILES}} 361 Returns the number of uploaded files (rows in the image table).
#redirect #REDIRECT [[target]]
at top of source page
Creates a redirect to another page.

Ask Dr Wiki Help Page

Quick Start.. Give me the Skinny

Editing basics

Advanced editing

Finding your way around the wiki

Page tricks


Advanced Timesavers

  • Some Magic Words

Communicating your edits

Help Videos You Can Watch


You can also visit AskDrWiki forum for more instructions.

Personal tools