Open main menu
Home
Random
Log in
Settings
About Chabadpedia
Chabadpedia
Search
Editing
Help:Magic words
(section)
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!
=== Formatting === {{further|mw:Help:Magic words#Formatting}} {| class="wikitable plainrowheaders" ! scope="col" | Function ! scope="col" | Description |- ! scope="row" id="lc" | <kbd>{<nowiki/>{lc:''string''}}</kbd> | Converts all characters in ''string'' to lower case. |- ! scope="row" id="lcfirst" | <kbd>{<nowiki/>{lcfirst:''string''}}</kbd> | Converts first character of ''string'' to lower case. |- ! scope="row" id="uc" | <kbd>{<nowiki/>{uc:''string''}}</kbd> | Converts all characters in ''string'' to upper case. |- ! scope="row" id="ucfirst" | <kbd>{<nowiki/>{ucfirst:''string''}}</kbd> | Converts first character of ''string'' to upper case. |- ! scope="row" id="formatnum" | <kbd>{<nowiki/>{formatnum:''unformatted_number''}}<br />{<nowiki/>{formatnum:''formatted_num'' {{pipe}}R}}</kbd> | Adds comma separators to an ''unformatted_number'' (e.g. 123456789 becomes {{formatnum:123456789}}). To remove such formatting, use <kbd>{<nowiki/>{formatnum:''formatted_number''{{pipe}}R}}</kbd> (i.e. <kbd>{{braces|formatnum:7,654,321{{pipe}}R}}</kbd>, for example, produces {{formatnum:7,654,321|R}}). |- ! scope="row" id="dateformat" | <kbd>{<nowiki/>{#dateformat:''date''{{pipe}}''format''}}<br />{<nowiki/>{#formatdate:''date''{{pipe}}''format''}}</kbd> | Formats a date according to user preferences; a default can be given as an optional case-sensitive second parameter for users without date preference; can convert a date from an existing format to any of <code>dmy</code>, <code>mdy</code>, <code>ymd</code>, or <code>[[ISO 8601]]</code> formats, with the user's preference overriding the specified format. |- ! scope="row" id="padleft" | <kbd>{<nowiki/>{padleft:''xyz''{{pipe}}''stringlength''}}<br />{<nowiki/>{padright:''xyz''{{pipe}}''stringlength''}}<br /><br />{<nowiki/>{padleft:''xyz''{{pipe}}''length''{{pipe}}''padstr''}}<br />{<nowiki/>{padright:''xyz''{{pipe}}''length''{{pipe}}''padstr''}}</kbd> | Pad with zeroes '0' to the right or left, to fill the given length; an alternative padding string can be given as a third parameter; the repeated padding string (''padstr'') will be truncated if its length does not evenly divide the required number of characters. |- ! scope="row" id="mCPlural" | <kbd>{<nowiki/>{plural:''N''{{pipe}}''singular''{{pipe}}''plural''}}</kbd> | Outputs ''singular'' if ''N'' is equal to 1, otherwise outputs ''plural''. See the [[mw:Help:Magic words#Localization|documentation at mediawiki.org]] for more details. |- ! scope="row" id="mwtime" | <kbd>{<nowiki/>{#time:''format''{{pipe}}''object''}}</kbd><br /><kbd>{<nowiki/>{#timel:''format''{{pipe}}''object''}}<br /><br />{<nowiki/>{#time:d F Y{{pipe}}''date''{{pipe}}''langcode''}}<br /><br />{<nowiki/>{#timef:object{{pipe}}''format type''{{pipe}}''langcode''}}</kbd> | Used to format dates and times, for ISO format, dots or English month names. <kbd>#timel</kbd> and <kbd>#timefl</kbd> are based on local time as defined for each wiki; for English Chabadpedia, this is identical to <kbd>#time</kbd> and <kbd>#timef</kbd>.<br />The optional 3rd parameter is the output language code (French, German, Swedish: fr, de, sv, etc.). Example Finnish: <kbd><nowiki>{{#time:d F Y|June 30, 2016|fi}}</nowiki></kbd> shows: {{#time:d F Y|June 30, 2016|fi}} (June). ISO to German: <kbd><nowiki>{{#time:d. M Y|1987-10-31|de}}</nowiki></kbd> shows: {{#time:d. M Y|1987-10-31|de}}.<br />For format codes, see: [[mw:Help:Extension:ParserFunctions##time]]. Use the format <kbd><nowiki>{{#time: H:i, j F Y (e)|...}}</nowiki></kbd> to match the format used by timestamps in signatures.<br /><kbd>#timef</kbd> formats a date using a standard format for the selected language, see: [[mw:Help:Extension:ParserFunctions##timef]]. |- ! scope="row" id="gender" | <kbd>{<nowiki/>{gender:''user''{{pipe}}''m_out''{{pipe}}''f_out''{{pipe}}''u_out''}}</kbd> | Outputs ''m_out'', ''f_out'' or ''u_out'' according to whether the gender specified in ''user''{{thinsp}}'s preferences is, respectively, male, female or unspecified. Other parameter permutations are available, see [[mw:Help:Magic words#gender]] and [[translatewiki:Special:MyLanguage/Gender|translatewiki:Gender]]. |- ! scope="row" id="mwtag" | <kbd>[[mw:Help:Magic words#Miscellaneous|{<nowiki/>{#tag:''tagname''{{pipe}}''content with magic''}}]]</kbd> | Only way to [[eval]]uate magic words ''inside a tag'', in order to generate <code><''tagname''>''magic''</''tagname''></code>. Also handles tag attributes. Details at [[mw:Help:Magic words#tag]]. |}
Edit summary
(Briefly describe your changes)
Please note that all contributions to Chabadpedia are considered to be released under the GNU Free Documentation License 1.3 or later (see
Chabadpedia: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!
Cancel
Editing help
(opens in new window)
This page is a member of 4 hidden categories:
Category:Chabadpedia pages with incorrect protection templates
Category:Pages with missing files
Category:Pages with script errors
Category:Pages with syntax highlighting errors