Wikia

GTA Wiki

Help:Magic Words

Talk0
10,405pages on
this wiki

Magic Words are phrases recognised by MediaWiki which perform special functions, such as showing a Table of Contents, or the name of the current page.

Read more at: http://meta.wikimedia.org/wiki/Help:Magic_words

Forces

These Magic Words force something to show, or be hidden

Magic Word Description
__TOC__ Forces the Table of Contents to show here, even if not required
__NOTOC__ Stops the Table of Contents from showing
__FORCETOC__ Forces the Table of Contents to show (in its normal position), even if not required
{{toc}} Floats the Table of Contents to the right
{{tocleft}} Floats the Table of Contents to the left
__NOEDITSECTION__ Stops the [edit] links from showing on this page
__NEWSECTIONLINK__ Makes a + button appear next to the edit tab, eg for adding a new section to a talk page
__NOGALLERY__ In a category page, make images show up in a list rather than in a thumbnail gallery
__HIDDENCAT__ In a category page, stops that category from showing up in the horizontal box on the bottom of pages within that category

Variables

These Magic Words echo out the contents of a variable, such as the date, or article name.


Date/Time

Magic Word Example Description
{{CURRENTDAY}} 20 The day of the month (eg 1)
{{CURRENTDAY2}} 20 The day of the month, with a leading zero (eg 01)
{{CURRENTDAYNAME}} Saturday The full name of the current day
{{CURRENTDOW}} 6 The numeric representation of the day of the week
{{CURRENTMONTH}} 12 The number of the current month, with a leading zero (eg 01)
{{CURRENTMONTHNAME}} December The full name of the current month
{{CURRENTMONTHABBREV}} Dec The abbreviated name of the current month
{{CURRENTTIME}} 03:49 The current time in 24h format
{{CURRENTHOUR}} 03 The current hour in 24h format, with a leading zero
{{CURRENTWEEK}} 51 The current week of the year, with no leading zero
{{CURRENTTIMESTAMP}} 20141220034934 The current ISO 8601 time stamp.
{{LOCALTIME}} 03:49 For most of the above date/time varibles, replacing CURRENT with LOCAL will show the current date/time of the Wiki's default settings, rather than that in the User's preferences.


Wiki Statistics

These variables echo out statistics from this wiki. Numeric values are shown with thousand separators (eg 1,000,000). Adding :R onto the end of some of these (eg {{NUMBEROFEDITS:R}}) will show the number in its raw format, without thousand separators (eg 1000000) which can be used in calculations.

Magic Word Example Description
{{CURRENTVERSION}} 1.19.20 Current version of MediaWiki used on this wiki
{{NUMBEROFEDITS}} 726,975 The total number of edits on this wiki
{{NUMBEROFPAGES}} 109,490 The total number of pages on this wiki, including everything
{{NUMBEROFARTICLES}} 10,405 The total number of articles on this wiki, including only legitimate articles
{{NUMBEROFFILES}} 35,364 The total number of files (images) uploaded to this wiki
{{NUMBEROFUSERS}} 23,925,733 The total number of Users in the entireity of Wikia
{{NUMBEROFADMINS}} 8 The total number of users on this wiki in the Administrator group

For the number of pages within a category, see other information (below)


Page Names

Adding an E onto the end of most of these page names will show the same function, but using underscores instead of spaces so it can be used in a web link (URL).

Magic Word Example Description
{{FULLPAGENAME}} Help:Magic Words The full name of the current page. AKA combines {{NAMESPACE}} and {{PAGENAME}}
{{PAGENAME}} Magic Words The name of the page, not including the namespace
{{PAGENAMEE}} Magic_Words The above, but using underscores to be URL-friendly
{{BASEPAGENAME}} Magic Words For subpages, shows the page above it. AKA removes everything after the last slash (/).
{{NAMESPACE}} Help The name of the current namespace
{{TALKSPACE}} Help talk The name of the next odd-numbered namespace. Usually the appropriate talk namespace.
{{SUBJECTSPACE}}
{{ARTICLESPACE}}
Help The name of the previous even-numbered namespace. For talk pages, this will show the namespace of the main article.
{{TALKPAGENAME}} Help talk:Magic Words The full link to the relevant talk page. AKA combines {{TALKSPACE}} and {{PAGENAME}}
{{SUBJECTPAGENAME}}
{{ARTICLEPAGENAME}}
Help:Magic Words The full link to the relevant main article. AKA combines {{SUBJECTSPACE}} and {{PAGENAME}}


Other Page Information

Magic Word Example Description
{{REVISIONID}} 246389 The Unique ID of the current page
{{REVISIONDAY}} 22 The day on which the page was last modified. {{REVISIONDAY2}} shows a leading zero.
{{REVISIONMONTH}} 07 The month on which the page was last modified
{{REVISIONYEAR}} 2010 The year on which the page was last modified
{{REVISIONTIMESTAMP}} 20100722060534 The timestamp of when the page was last modified
{{PAGESINCATEGORY:Cleanup}} 103 The number of pages within a given category. {{PAGESINCAT:category}} also works
{{PAGESIZE:page}} 1,644 The byte size of a given page


Namespaces and URLs

Magic Word Example Description
{{SITENAME}} GTA Wiki The full site name
{{SERVER}} http://gta.wikia.com The URL of the wiki
{{SERVERNAME}} gta.wikia.com The domain name of the wiki
{{SCRIPTPATH}} The path (after the server name) to the wiki pages
{{ns:1}} Talk The name of a namespace number
{{#special:}} No such special page Links to a special page
{{localurl:Main Page}} /Main_Page The local URL of a page name
{{localurl:Main Page|action=purge}} /Main_Page?action=purge The local URL of a page name, with parameters
{{localurl:Wikipedia:Category}} http://en.wikipedia.org/wiki/Category The local URL to an external page will show up as a full URL
{{SERVER}}{{localurl:Main Page}} http://gta.wikia.com/Main_Page The full URL to a page is created by using the server URL then adding the full page name in localurl, which turns spaces to underscores
{{SERVER}}{{localurl:{{TALKPAGENAME}}}} http://gta.wikia.com/Help_talk:Magic_Words The full URL to a talk page can be ouput in the same way as a page name
{{SERVER}}{{localurl:{{TALKPAGENAME}}|action=edit}} http://gta.wikia.com/Help_talk:Magic_Words?action=edit The full URL to Edit a talk page can be given using localurl and the edit parameter


Formatting

Magic Word Example Description
{{lc:AbC dEf}} abc def Turns a string to lower case
{{uc:AbC dEf}} ABC DEF Turns a string to upper case
{{lcfirst:TESTing}} testing Makes the first character of a string into lower case
{{ucfirst:testing}} Testing Makes the first character of a string into upper case
{{formatnum:-218744561.35123}} -218,744,561.35123 Formats a number string, adds thousand separator as appropriate. Recognises positive/negative.
{{padleft:7|3}} 007 Pads a number/string (first variable) to the specified length of digits (second variable) to the left using a zero
{{padleft:7|3|X}} XX7 Pads a number/string to the specified length of digits to the left using a specified character (third variable)
{{padright:C|3|S}} CSS Pads a number/string (as above) to the right
{{#language:de}} Deutsch Shows the native name of a language ID code


Image Modifiers

Magic Word Usage Example Description
framed
frame
enframed
[[Image:Blank.jpg|framed|Caption]]
Blank

Caption

Places an image in a frame with a description. Uses original size and stubbornly ignores width parameter if given.

In general, far better to use thumb, as is only suitable for small images.

thumb
thumbnail
[[Image:Blank.jpg|thumb|Caption]]
Blank

Caption

Modifies image size, sets it dependent on user's favorite thumbnail size in one's preferences, or on the given width parameter (see below).
thumb=image.jpg [[Image:Blank.jpg|thumb=clock.svg|Caption]]
File:Blank.jpg
Shows a thumbnail image of choice
border [[Image:Clock.svg|border]] File:Clock.svg Shows a 1px border around the image
40px [[Image:Blank.jpg|40px]] Blank Resizes an image to specified dimensions. If one dimension is specified, it sets the width and maintains the aspect ratio.
50x100px [[Image:Blank.jpg|50x100px]] Blank If two dimensions are specified (width x height), it uses them as maximums . EG it scales image to no more than 50 pixels wide and no more than 100 high, but image scaled to retain its true aspect ratio within the boundary specified.
40px|Caption [[Image:Blank.jpg|thumb|80px|Caption]]
Blank

Caption

Shows a thumbnail of the image, resizes the thumbnail, adds a caption


Image Position

Magic Word Usage Example Description
right Text1 Text1 Text1

[[Image:Blank.jpg|right]] Text2 Text2 Text2
Text3 Text3 Text3

Text1 Text1 Text1
Blank

Text2 Text2 Text2
Text3 Text3 Text3

Floats an image (or thumbnail) right. Text will wrap to the left of it.
left Text1 Text1 Text1

[[Image:Blank.jpg|left]] Text2 Text2 Text2
Text3 Text3 Text3

Text1 Text1 Text1
Blank

Text2 Text2 Text2
Text3 Text3 Text3

Floats an image (or thumbnail) left. Text will wrap to the right of it.
none Text1 Text1 Text1

[[Image:Blank.jpg|none]] Text2 Text2 Text2
Text3 Text3 Text3

Text1 Text1 Text1
Blank

Text2 Text2 Text2
Text3 Text3 Text3

Explicitly states that the image will not float
center
centre
Text1 Text1 Text1

[[Image:Blank.jpg|center]] Text2 Text2 Text2
Text3 Text3 Text3

Text1 Text1 Text1
Blank

Text2 Text2 Text2
Text3 Text3 Text3

Centers an image, still acts like none. Works with either British or American spelling.


Template Modifiers

Magic Word Example Description
{{:GTA}} (no example included due to size of GTA page) A leading colon is the prefix for the name namespace (IE an empty namespace). This will transclude the specified page, not the page within the template: namespace. This example will include GTA not Template:GTA.
{{int:GTA}}
{{int:currentevents}}
<GTA>
Latest News
Includes a page from the MediaWiki namespace. Same as {{mediaWiki:GTA}}, but also doesn't show up under Templates used on this page. Rendered as <GTA> if MediaWiki:GTA doesn't exist.
{{msgnw:Col-end}}
{{raw:Col-end}}
<p></p>

|}<noinclude>{{protected template}} {{Col-begin/doc}}</noinclude>

Includes the wikitext (markup, raw code) of a page. Does not render the page.
{{subst:GTA}} -- The content of the mentioned page is copied into this page. The include tag is replaced by the markup of the target page. The template will appear to show as normal, but changes to the template will not affect this page.


Other

Magic Word Example Description
{{DISPLAYTITLE:GTA}} -- Changes a page's title, as displayed at in the header at the top of the page
{{CONTENTLANGUAGE}} en The ID Code of the site's default interface language
#REDIRECT [[Page]] -- Automatically redirects this page to another. Cannot be used to redirect across wikis. Cannot redirect more than once at a time. Redirects can be ignored with &redirect=no on the URL.
[[Category:category_name|sort_key]] [[Category:Characters|Johnson, Carl]]

[[Category:Grand Theft Auto IV|Missions]]
When a page is listed on a category page, it will be sorted and listed in alphabetical order. That can be overridden by adding a sort key, which sorts this example for Carl Johnson under J rather than under C, which is useful for Surnames.
This can also be used to eliminate repetition in titles, such as changing Missions in GTA IV to be listed as "Missions".
Magicword

An example of magic word input and rendering

A "magic word" is a keyword or phrase recognized by MediaWiki software (which Wikia is built on), which triggers the software to do something special on the page. When editing in the visual editor, magic words on the page will show up as a green puzzle piece.

Step-by-Step

  • To add a magic word, simply add the magic word to the content of the page somewhere. It will look like code, but after you save (or preview), it will work as intended.
    • Magic words can be added in either editor (source or visual); however, source mode must be used to edit a magic word. Alternatively, in the visual editor, you can simply remove the magic word you wish to change and add the new one.

Common Magic Words

Here are some of the magic words used most commonly at Wikia:

  • __NOTOC__ hides the table of contents on a page.
  • __TOC__ places the table of contents exactly where this is entered. It overrides the NOTOC switch.
  • __NOWYSIWYG__, disables the rich text editor on a page.
  • {{CURRENTDAYNAME}} produces the current day of the week.
  • {{NUMBEROFARTICLES}} shows the number of articles on your wikia.
  • {{SITENAME}} produces the name of the wikia.
  • {{PAGENAME}} produces the name of the page the word is placed on.
  • {{FULLPAGENAME}} produces the entire page name, i.e. along with the namespace, of the page it is placed on.

Full list of Magic Words

For a full list of available magic words, see the Magic words help page on MediaWiki. [1]

Wikia-Specific Magic Words

Some extensions or features unique to Wikia also have magic words associated with them. Here is a comprehensive list:

Wiki Navigation

These magic words will fill in data for your wikia navigation bar. To utilize them, these must be placed on the MediaWiki:Wiki-navigation page:

  • #categoryX# - where X is a number greater than 0. This gets the top 8 pages from the X biggest category on a wiki.
  • #category-Foo# - Gets the top 8 pages from Category:Foo.
  • #visited# - Populates a list of the top visited pages from MediaWiki:Most popular articles.
  • #newlychanged# - Gets recently edited pages.
  • #topusers# - Gets a list of the most active users.

Category Galleries

These magic words will apply to the Category Gallery feature when left on a Category page:

  • __NOCATEGORYGALLERY__ - Hides a category gallery from being rendered on a category page.
  • __FORCECATEGORYGALLERY__ - If the category gallery is enabled on a wikia, but it is not applied to all categories by default, this will add a category gallery to the category page.

Notes

  1. Some magic words may function differently, or not work, at Wikia. This occurs because the version of the MediaWiki software used by Wikia is not always the same version as those of either MediaWiki.org or Wikipedia.org.

See also

Further help and feedback

Around Wikia's network

Random Wiki