Help:Magic words: Difference between revisions

From Wikipedia of the Dark Brotherhood, an online Star Wars Club
m (Help:Magic words complete)
 
(import from google cache)
Line 1: Line 1:
{{Help contents back}}
<table style="background:transparent"><tr>
'''Magic words''' (which include '''parser functions''', '''variables''' and '''behavior switches''') are features of wikitext that enable various instructions to be given to the MediaWiki software (for example, to suppress or position the table of contents), or else serve to produce variable output, as is often required in templates.
<td> [[Help:Contents|<img alt="" src="/code/images/thumb/8/8e/1leftarrow.png/16px-1leftarrow.png" width="16" height="16" border="0">]]
</td>
<td> <big>[[Help:Contents]]</big>
</td>
</tr></table>'''Magic words''' (which include '''parser functions''', '''variables''' and '''behavior switches''') are features of wikitext that enable various instructions to be given to the MediaWiki software (for example, to suppress or position the table of contents), or else serve to produce variable output, as is often required in templates.


==General information==
 
 
== General information ==
There are three types of magic words:
There are three types of magic words:
*'''Behavior switches:''' uppercase words surrounded by double underscores, e.g. <tt><nowiki>__NOTOC__</nowiki></tt>, or keywords using parser function syntax
*'''Variables:''' uppercase words surrounded by double braces, e.g. <tt><nowiki>{{PAGENAME}}</nowiki></tt> (thus resembling [[Help:Templates|templates]])
*'''Parser functions:''' keywords (some beginning #) in double braces with parameters after a colon, e.g. <tt><nowiki>{{#expr:2+2}}</nowiki></tt>


Some magic words are case-insensitive, but not all. Whitespace is stripped from the start and end of keywords and parameters, as in template syntax.


Page-dependent magic words will affect or return data about the ''current'' page, even if the word is added through a transcluded template or included system message.
* '''Behavior switches:''' uppercase words surrounded by double underscores, e.g. <tt>__NOTOC__</tt>, or keywords using parser function syntax
* '''Variables:''' uppercase words surrounded by double braces, e.g. <tt>{{PAGENAME}}</tt> (thus resembling [[Help:Templates|templates]])
* '''Parser functions:''' keywords (some beginning #) in double braces with parameters after a colon, e.g. <tt>{{#expr:2+2}}</tt>
Some magic words are case-insensitive, but not all. Whitespace is stripped from the start and end of keywords and parameters, as in '''template''' syntax.
 
Page-dependent magic words will affect or return data about the ''current'' page, even if the word is added through a transcluded '''template''' or included system message.


==Behavior switches==
 
 
== Behavior switches ==
''For documentation, refer to the [http://www.mediawiki.org/wiki/Help:Magic_words#Behavior_switches Behavior Switches] section of the MediaWiki page.''
''For documentation, refer to the [http://www.mediawiki.org/wiki/Help:Magic_words#Behavior_switches Behavior Switches] section of the MediaWiki page.''
*<tt><nowiki>__NOTOC__</nowiki></tt> (can appear anywhere in the wikitext; suppresses the table of contents)
*<tt><nowiki>__FORCETOC__</nowiki></tt> (can appear anywhere in the wikitext; makes a table of contents appear in its normal position above the first header)
*<tt><nowiki>__TOC__</nowiki></tt> (places a table of contents at the word's position)


*<tt><nowiki>__NOEDITSECTION__</nowiki></tt> (hides the section edit links beside headings)
*<tt><nowiki>__NEWSECTIONLINK__</nowiki></tt> (adds a "+" link for adding a new section on a non-"Talk" page)
*<tt><nowiki>__NONEWSECTIONLINK__</nowiki></tt> (removes the "+" link on "Talk" pages)


*<tt><nowiki>__NOGALLERY__</nowiki></tt> (on a category page, replaces thumbnails with normal links)
* <tt>__NOTOC__</tt> (can appear anywhere in the wikitext; suppresses the table of contents)
*<tt><nowiki>__HIDDENCAT__</nowiki></tt> (on a category page, makes it a hidden category)
* <tt>__FORCETOC__</tt> (can appear anywhere in the wikitext; makes a table of contents appear in its normal position above the first header)
*<tt><nowiki>__INDEX__</nowiki></tt> (tells search engines to index the page)
* <tt>__TOC__</tt> (places a table of contents at the word's position)
*<tt><nowiki>__NOINDEX__</nowiki></tt> (tells search engines not to index the page)
* <tt>__NOEDITSECTION__</tt> (hides the section edit links beside headings)
* <tt>__NEWSECTIONLINK__</tt> (adds a "+" link for adding a new section on a non-"Talk" page)
* <tt>__NONEWSECTIONLINK__</tt> (removes the "+" link on "Talk" pages)
* <tt>__NOGALLERY__</tt> (on a category page, replaces thumbnails with normal links)
* <tt>__HIDDENCAT__</tt> (on a category page, makes it a hidden category)
* <tt>__INDEX__</tt> (tells search engines to index the page)
* <tt>__NOINDEX__</tt> (tells search engines not to index the page)
* <tt>{{DISPLAYTITLE:''title''}}</tt> (changes the displayed form of the page title)
* <tt>{{DEFAULTSORT:''sortkey''}}</tt> (sets a default category sort key)


*<tt><nowiki>{{DISPLAYTITLE:</nowiki>''title''<nowiki>}}</nowiki></tt> (changes the displayed form of the page title)
==  Variables  ==
*<tt><nowiki>{{DEFAULTSORT:</nowiki>''sortkey''<nowiki>}}</nowiki></tt> (sets a default category sort key)
''For documentation, refer to the [http://www.mediawiki.org/wiki/Help:Magic_words#Variables Variables] section of the MediaWiki page.''


==Variables==
''For documentation, refer to the [http://www.mediawiki.org/wiki/Help:Magic_words#Variables Variables] section of the MediaWiki page.''
*<tt><nowiki>{{FULLPAGENAME}}</nowiki></tt> (page title including namespace)
*<tt><nowiki>{{PAGENAME}}</nowiki></tt> (page title excluding namespace)
*<tt><nowiki>{{BASEPAGENAME}}</nowiki></tt> (page title excluding subpage and namespace)
*<tt><nowiki>{{SUBPAGENAME}}</nowiki></tt> (subpage part of title)
*<tt><nowiki>{{SUBJECTPAGENAME}}</nowiki></tt> (associated non-talk page)
*<tt><nowiki>{{TALKPAGENAME}}</nowiki></tt> (associated talk page)
*<tt><nowiki>{{NAMESPACE}}</nowiki></tt> (namespace of current page)
*<tt><nowiki>{{SUBJECTSPACE}}, {{ARTICLESPACE}}</nowiki></tt> (associated non-talk namespace)
*<tt><nowiki>{{TALKSPACE}}</nowiki></tt> (associated talk namespace)
* <tt><nowiki>{{FULLPAGENAMEE}}, {{NAMESPACEE}}</nowiki></tt> etc. (URL-encoded equivalents)


* <tt>{{FULLPAGENAME}}</tt> (page title including namespace)
* <tt>{{PAGENAME}}</tt> (page title excluding namespace)
* <tt>{{BASEPAGENAME}}</tt> (page title excluding subpage and namespace)
* <tt>{{SUBPAGENAME}}</tt> (subpage part of title)
* <tt>{{SUBJECTPAGENAME}}</tt> (associated non-talk page)
* <tt>{{TALKPAGENAME}}</tt> (associated talk page)
* <tt>{{NAMESPACE}}</tt> (namespace of current page)
* <tt>{{SUBJECTSPACE}}, {{ARTICLESPACE}}</tt> (associated non-talk namespace)
* <tt>{{TALKSPACE}}</tt> (associated talk namespace)
* <tt>{{FULLPAGENAMEE}}, {{NAMESPACEE}}</tt> etc. (URL-encoded equivalents)
The above can all take a parameter, to operate on a page other than the current page.
The above can all take a parameter, to operate on a page other than the current page.


*<tt><nowiki>{{SITENAME}}</nowiki></tt> ({{SITENAME}})
*<tt><nowiki>{{SERVER}}</nowiki></tt> (<nowiki>http://en.wikipedia.org</nowiki>)
*<tt><nowiki>{{SERVERNAME}}</nowiki></tt> ({{SERVERNAME}})
*<tt><nowiki>{{SCRIPTPATH}}</nowiki></tt> ({{SCRIPTPATH}})
*<tt><nowiki>{{CURRENTVERSION}}</nowiki></tt> (current MediaWiki version)
*<tt><nowiki>{{REVISIONID}}</nowiki></tt> (latest revision to current page)
*<tt><nowiki>{{REVISIONDAY}}, {{REVISIONDAY2}}, {{REVISIONMONTH}}, {{REVISIONYEAR}}, {{REVISIONTIMESTAMP}}, {{REVISIONUSER}}</nowiki></tt> (date, time, editor at last edit)


*<tt><nowiki>{{CURRENTYEAR}}, {{CURRENTMONTH}}, {{CURRENTMONTHNAME}}, {{CURRENTMONTHABBREV}}, {{CURRENTDAY}}, {{CURRENTDAY2}}, {{CURRENTDOW}}, {{CURRENTDAYNAME}}, {{CURRENTTIME}}, {{CURRENTHOUR}}, {{CURRENTWEEK}}, {{CURRENTTIMESTAMP}}</nowiki></tt> (current date/time variables)  
* <tt>{{SITENAME}}</tt> (Wikipedia of the Dark Jedi Brotherhood, an online Star Wars Club)
*<tt><nowiki>{{LOCALYEAR}}</nowiki></tt> etc. (as above, based on site's local time)
* <tt>{{SERVER}}</tt> (http://en.wikipedia.org)
* <tt>{{SERVERNAME}}</tt> (wiki.darkjedibrotherhood.com)
* <tt>{{SCRIPTPATH}}</tt> (/code)
* <tt>{{CURRENTVERSION}}</tt> (current MediaWiki version)
* <tt>{{REVISIONID}}</tt> (latest revision to current page)
* <tt>{{REVISIONDAY}}, {{REVISIONDAY2}}, {{REVISIONMONTH}}, {{REVISIONYEAR}}, {{REVISIONTIMESTAMP}}, {{REVISIONUSER}}</tt> (date, time, editor at last edit)
* <tt>{{CURRENTYEAR}}, {{CURRENTMONTH}}, {{CURRENTMONTHNAME}}, {{CURRENTMONTHABBREV}}, {{CURRENTDAY}}, {{CURRENTDAY2}}, {{CURRENTDOW}}, {{CURRENTDAYNAME}}, {{CURRENTTIME}}, {{CURRENTHOUR}}, {{CURRENTWEEK}}, {{CURRENTTIMESTAMP}}</tt> (current date/time variables)  
* <tt>{{LOCALYEAR}}</tt> etc. (as above, based on site's local time)
* <tt>{{NUMBEROFPAGES}}, {{NUMBEROFARTICLES}}, {{NUMBEROFFILES}}, {{NUMBEROFEDITS}}, {{NUMBEROFVIEWS}}, {{NUMBEROFUSERS}}, {{NUMBEROFADMINS}}, {{NUMBEROFACTIVEUSERS}}</tt> (statistics on English Wikipedia; add <tt>:R</tt> to return numbers without commas)


*<tt><nowiki>{{NUMBEROFPAGES}}, {{NUMBEROFARTICLES}}, {{NUMBEROFFILES}}, {{NUMBEROFEDITS}}, {{NUMBEROFVIEWS}}, {{NUMBEROFUSERS}}, {{NUMBEROFADMINS}}, {{NUMBEROFACTIVEUSERS}}</nowiki></tt> (statistics on English Wikipedia; add <tt>:R</tt> to return numbers without commas)
==  Parser functions  ==
''These are documented at the [http://www.mediawiki.org/wiki/Help:Magic_words main documentation page] unless otherwise stated.''


==Parser functions==
''These are documented at the [http://www.mediawiki.org/wiki/Help:Magic_words main documentation page] unless otherwise stated.''


===Metadata===
*<tt><nowiki>{{PAGESIZE:</nowiki>''page name''<nowiki>}}</nowiki></tt> (size of page in bytes)
*<tt><nowiki>{{PROTECTIONLEVEL:</nowiki>''action''<nowiki>}}</nowiki></tt> (protection level for given action on the current page)
*<tt><nowiki>{{PAGESINCATEGORY:</nowiki>''categoryname''<nowiki>}}</nowiki></tt> (number of pages in the given [[Help:Category|category]])
*<tt><nowiki>{{NUMBERINGROUP:</nowiki>''groupname''<nowiki>}}</nowiki></tt> (number of users in a specific group)


===  Metadata  ===
* <tt>{{PAGESIZE:''page name''}}</tt> (size of page in bytes)
* <tt>{{PROTECTIONLEVEL:''action''}}</tt> (protection level for given action on the current page)
* <tt>{{PAGESINCATEGORY:''categoryname''}}</tt> (number of pages in the given [[Help:Category|category]])
* <tt>{{NUMBERINGROUP:''groupname''}}</tt> (number of users in a specific group)
Add <tt>|R</tt> to return numbers without commas.
Add <tt>|R</tt> to return numbers without commas.


===Formatting===
*<tt><nowiki>{{lc:</nowiki>''string''<nowiki>}}</nowiki></tt> (convert to lower case)
*<tt><nowiki>{{lcfirst:</nowiki>''string''<nowiki>}}</nowiki></tt> (convert first character to lower case)
*<tt><nowiki>{{uc:</nowiki>''string''<nowiki>}}</nowiki></tt> (convert to upper case)
*<tt><nowiki>{{ucfirst:</nowiki>''string''<nowiki>}}</nowiki></tt> (convert first character to upper case)
*<tt><nowiki>{{formatnum:</nowiki>''unformatted&nbsp;num''<nowiki>}}</nowiki></tt> (format a number with comma separators; add <tt><nowiki>|</nowiki>R</tt> to unformat a number)
*<tt><nowiki>{{#formatdate:</nowiki>''date''<nowiki>}}</nowiki></tt> (formats a date according to user preferences; a default can be given as a second parameter for users without date preference).
*<tt><nowiki>{{padleft:xyz|</nowiki>''stringlength''<nowiki>}}</nowiki></tt>, <tt><nowiki>{{padright:xyz|</nowiki>''stringlength''<nowiki>}}</nowiki></tt> (pad with zeros to the right or left; an alternative padding string can be given as a third parameter)
*<tt><nowiki>{{plural:</nowiki>''n''|''is''<nowiki>|</nowiki>''are''<nowiki>}}</nowiki></tt> (produces alternative text according to whether ''n'' is greater than 1)
*<tt><nowiki>{{#time: format string | date/time object }}</nowiki></tt> (for date/time formatting; also <tt>#timel</tt> for local time. Covered at the [http://www.mediawiki.org/wiki/Help:Extension:ParserFunctions extension documentation page].)


===Paths===
*<tt><nowiki>{{localurl:</nowiki>''page name''<nowiki>}}</nowiki></tt>, <tt><nowiki>{{localurl:</nowiki>''page name''<nowiki>|</nowiki>''query string''<nowiki>}}</nowiki></tt> (relative path to the title)
*<tt><nowiki>{{fullurl:</nowiki>''page name''<nowiki>}}</nowiki></tt>, <tt><nowiki>{{fullurl:</nowiki>''page name''<nowiki>|</nowiki>''query_string''<nowiki>}}</nowiki></tt> (absolute path to the title)
*<tt><nowiki>{{filepath:</nowiki>''file name''<nowiki>}}</nowiki></tt> (absolute URL to a media file)
*<tt><nowiki>{{urlencode:</nowiki>''string''<nowiki>}}</nowiki></tt> (input encoded for use in URLs)
*<tt><nowiki>{{anchorencode:</nowiki>''string''<nowiki>}}</nowiki></tt> (input encoded for use in URL section anchors)
*<tt><nowiki>{{ns:</nowiki>''n''<nowiki>}}</nowiki></tt> (name for the namespace with index ''n''; use <tt><nowiki>{{nse:}}</nowiki></tt> for URL-encoded equivalent)
*<tt><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></tt> (converts a relative file path to absolute; see the extension documentation above)
*<tt><nowiki>{{#titleparts: pagename | number of segments to return | first segment to return }}</nowiki></tt> (splits title into parts; see the extension documentation above)


===Conditional expressions===
=== Formatting  ===
* <tt>{{lc:''string''}}</tt> (convert to lower case)
* <tt>{{lcfirst:''string''}}</tt> (convert first character to lower case)
* <tt>{{uc:''string''}}</tt> (convert to upper case)
* <tt>{{ucfirst:''string''}}</tt> (convert first character to upper case)
* <tt>{{formatnum:''unformatted num''}}</tt> (format a number with comma separators; add <tt>|R</tt> to unformat a number)
* <tt>{{#formatdate:''date''}}</tt> (formats a date according to user preferences; a default can be given as a second parameter for users without date preference).
* <tt>{{padleft:xyz|''stringlength''}}</tt>, <tt>{{padright:xyz|''stringlength''}}</tt> (pad with zeros to the right or left; an alternative padding string can be given as a third parameter)
* <tt>{{plural:''n''|''is''|''are''}}</tt> (produces alternative text according to whether ''n'' is greater than 1)
* <tt>{{#time: format string | date/time object }}</tt> (for date/time formatting; also <tt>#timel</tt> for local time. Covered at the [http://www.mediawiki.org/wiki/Help:Extension:ParserFunctions extension documentation page].)
 
===  Paths  ===
* <tt>{{localurl:''page name''}}</tt>, <tt>{{localurl:''page name''|''query string''}}</tt> (relative path to the title)
* <tt>{{fullurl:''page name''}}</tt>, <tt>{{fullurl:''page name''|''query_string''}}</tt> (absolute path to the title)
* <tt>{{filepath:''file name''}}</tt> (absolute URL to a media file)
* <tt>{{urlencode:''string''}}</tt> (input encoded for use in URLs)
* <tt>{{anchorencode:''string''}}</tt> (input encoded for use in URL section anchors)
* <tt>{{ns:''n''}}</tt> (name for the namespace with index ''n''; use <tt>{{nse:}}</tt> for URL-encoded equivalent)
* <tt>{{#rel2abs: ''path'' }}</tt> (converts a relative file path to absolute; see the extension documentation above)
* <tt>{{#titleparts: pagename | number of segments to return | first segment to return }}</tt> (splits title into parts; see the extension documentation above)
 
===  Conditional expressions ===
These are covered at the extension documentation page (above). Some parameters are optional.
These are covered at the extension documentation page (above). Some parameters are optional.
*<tt><nowiki>{{#expr:</nowiki> ''expression'' <nowiki>}}</nowiki></tt> (evaluates the given expression; see [http://en.wikipedia.org/wiki/Help:Calculation Help:Calculation] on Wookieepedia)
*<tt><nowiki>{{#if:</nowiki> ''test string'' | ''value if non-empty'' | ''value if empty'' <nowiki>}}</nowiki></tt> (selects one of two values based on whether the test string is empty)
*<tt><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if equal'' <nowiki>|</nowiki> ''value if unequal'' <nowiki>}}</nowiki></tt> (selects one of two values based on whether the test strings are equal – numerically if applicable)
*<tt><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></tt> (selects value based on whether the test string generates a parser error)
*<tt><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></tt> (selects value based on evaluation of expression)
*<tt><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></tt> (selects value depending on whether a page title exists)
*<tt><nowiki>{{#switch: test | case1 = value for case 1 | ... | default }}</nowiki></tt> (provides alternatives based on the value of the test string)


* <tt>{{#expr: ''expression'' }}</tt> (evaluates the given expression; see [http://en.wikipedia.org/wiki/Help:Calculation Help:Calculation] on Wookieepedia)
* <tt>{{#if: ''test string'' | ''value if non-empty'' | ''value if empty'' }}</tt> (selects one of two values based on whether the test string is empty)
* <tt>{{#ifeq: ''string 1'' | ''string 2'' | ''value if equal'' | ''value if unequal'' }}</tt> (selects one of two values based on whether the test strings are equal – numerically if applicable)
* <tt>{{#iferror: ''test string'' | ''value if error'' | ''value if correct'' }}</tt> (selects value based on whether the test string generates a parser error)
* <tt>{{#ifexpr: ''expression'' | ''value if true'' | ''value if false'' }}</tt> (selects value based on evaluation of expression)
* <tt>{{#ifexist: ''page title'' | ''value if exists'' | ''value if doesn't exist'' }}</tt> (selects value depending on whether a page title exists)
* <tt>{{#switch: test | case1 = value for case 1 | ... | default }}</tt> (provides alternatives based on the value of the test string)
For the use of these functions in tables, see [http://en.wikipedia.org/wiki/Wikipedia:Conditional_tables Conditional tables].
For the use of these functions in tables, see [http://en.wikipedia.org/wiki/Wikipedia:Conditional_tables Conditional tables].


[[Category:DJB Help]]
[[Category:DJB Help]]

Revision as of 06:43, 23 May 2011

<img alt="" src="/code/images/thumb/8/8e/1leftarrow.png/16px-1leftarrow.png" width="16" height="16" border="0"> Help:Contents

Magic words (which include parser functions, variables and behavior switches) are features of wikitext that enable various instructions to be given to the MediaWiki software (for example, to suppress or position the table of contents), or else serve to produce variable output, as is often required in templates.


General information

There are three types of magic words:


  • Behavior switches: uppercase words surrounded by double underscores, e.g. , or keywords using parser function syntax
  • Variables: uppercase words surrounded by double braces, e.g. Magic words (thus resembling templates)
  • Parser functions: keywords (some beginning #) in double braces with parameters after a colon, e.g. 4

Some magic words are case-insensitive, but not all. Whitespace is stripped from the start and end of keywords and parameters, as in template syntax.

Page-dependent magic words will affect or return data about the current page, even if the word is added through a transcluded template or included system message.


Behavior switches

For documentation, refer to the Behavior Switches section of the MediaWiki page.


  • (can appear anywhere in the wikitext; suppresses the table of contents)
  • (can appear anywhere in the wikitext; makes a table of contents appear in its normal position above the first header)
  • (places a table of contents at the word's position)
  • (hides the section edit links beside headings)
  • (adds a "+" link for adding a new section on a non-"Talk" page)
  • (removes the "+" link on "Talk" pages)
  • (on a category page, replaces thumbnails with normal links)
  • (on a category page, makes it a hidden category)
  • (tells search engines to index the page)
  • (tells search engines not to index the page)
  • (changes the displayed form of the page title)
  • (sets a default category sort key)

Variables

For documentation, refer to the Variables section of the MediaWiki page.


  • Help:Magic words (page title including namespace)
  • Magic words (page title excluding namespace)
  • Magic words (page title excluding subpage and namespace)
  • Magic words (subpage part of title)
  • Help:Magic words (associated non-talk page)
  • Help talk:Magic words (associated talk page)
  • Help (namespace of current page)
  • Help, Help (associated non-talk namespace)
  • Help talk (associated talk namespace)
  • Help:Magic_words, Help etc. (URL-encoded equivalents)

The above can all take a parameter, to operate on a page other than the current page.


  • Wikipedia of the Dark Brotherhood, an online Star Wars Club (Wikipedia of the Dark Jedi Brotherhood, an online Star Wars Club)
  • https://wiki.darkjedibrotherhood.com (http://en.wikipedia.org)
  • wiki.darkjedibrotherhood.com (wiki.darkjedibrotherhood.com)
  • (/code)
  • 1.41.0 (current MediaWiki version)
  • 89995 (latest revision to current page)
  • 23, 23, 05, 2011, 20110523064329, Orv Dessrx (date, time, editor at last edit)
  • 2024, 11, November, Nov, 22, 22, 5, Friday, 06:16, 06, 47, 20241122061658 (current date/time variables)
  • 2024 etc. (as above, based on site's local time)
  • 18,352, 4,122, 7,426, 204,060, Template:NUMBEROFVIEWS, 994, 18, 24 (statistics on English Wikipedia; add :R to return numbers without commas)

Parser functions

These are documented at the main documentation page unless otherwise stated.


Metadata

  • 0 (size of page in bytes)
  • (protection level for given action on the current page)
  • 0 (number of pages in the given category)
  • 0 (number of users in a specific group)

Add |R to return numbers without commas.


Formatting

  • string (convert to lower case)
  • string (convert first character to lower case)
  • STRING (convert to upper case)
  • string (convert first character to upper case)
  • unformatted num (format a number with comma separators; add |R to unformat a number)
  • date (formats a date according to user preferences; a default can be given as a second parameter for users without date preference).
  • xyz, xyz (pad with zeros to the right or left; an alternative padding string can be given as a third parameter)
  • are (produces alternative text according to whether n is greater than 1)
  • Error: Invalid time. (for date/time formatting; also #timel for local time. Covered at the extension documentation page.)

Paths

Conditional expressions

These are covered at the extension documentation page (above). Some parameters are optional.


  • Expression error: Unrecognized punctuation character "'". (evaluates the given expression; see Help:Calculation on Wookieepedia)
  • value if non-empty (selects one of two values based on whether the test string is empty)
  • value if unequal (selects one of two values based on whether the test strings are equal – numerically if applicable)
  • value if correct (selects value based on whether the test string generates a parser error)
  • Expression error: Unrecognized punctuation character "'". (selects value based on evaluation of expression)
  • value if doesn't exist (selects value depending on whether a page title exists)
  • default (provides alternatives based on the value of the test string)

For the use of these functions in tables, see Conditional tables.