CINXE.COM
Help:Extension:ParserFunctions - MediaWiki
<!DOCTYPE html> <html class="client-nojs vector-feature-language-in-header-disabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-disabled skin-theme-clientpref-day vector-toc-available" lang="en" dir="ltr"> <head> <meta charset="UTF-8"> <title>Help:Extension:ParserFunctions - MediaWiki</title> <script>(function(){var className="client-js vector-feature-language-in-header-disabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-disabled skin-theme-clientpref-day vector-toc-available";var cookie=document.cookie.match(/(?:^|; )mediawikiwikimwclientpreferences=([^;]+)/);if(cookie){cookie[1].split('%2C').forEach(function(pref){className=className.replace(new RegExp('(^| )'+pref.replace(/-clientpref-\w+$|[^\w-]+/g,'')+'-clientpref-\\w+( |$)'),'$1'+pref+'$2');});}document.documentElement.className=className;}());RLCONF={"wgBreakFrames":false,"wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""], "wgDefaultDateFormat":"dmy","wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","November","December"],"wgRequestId":"75ed0287-f022-4b27-bc47-ba9e1bdfa531","wgCanonicalNamespace":"Help","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":12,"wgPageName":"Help:Extension:ParserFunctions","wgTitle":"Extension:ParserFunctions","wgCurRevisionId":6816696,"wgRevisionId":6816696,"wgArticleId":33533,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":["Extension help","Magic words"],"wgPageViewLanguage":"en","wgPageContentLanguage":"en","wgPageContentModel":"wikitext","wgRelevantPageName":"Help:Extension:ParserFunctions","wgRelevantArticleId":33533,"wgIsProbablyEditable":false,"wgRelevantPageIsProbablyEditable":false,"wgRestrictionEdit":["autoconfirmed"],"wgRestrictionMove":["autoconfirmed"],"wgNoticeProject":"mediawiki","wgCiteReferencePreviewsActive":true, "wgMediaViewerOnClick":true,"wgMediaViewerEnabledByDefault":true,"wgVisualEditor":{"pageLanguageCode":"en","pageLanguageDir":"ltr","pageVariantFallbacks":"en"},"wgMFDisplayWikibaseDescriptions":{"search":true,"watchlist":true,"tagline":false,"nearby":true},"wgWMESchemaEditAttemptStepOversample":false,"wgWMEPageLength":100000,"wgInternalRedirectTargetUrl":"/wiki/Help:Extension:ParserFunctions#ifexist","wgTranslatePageTranslation":"source","wgEditSubmitButtonLabelPublish":true,"wgDiscussionToolsFeaturesEnabled":{"replytool":true,"newtopictool":true,"sourcemodetoolbar":true,"topicsubscription":false,"autotopicsub":false,"visualenhancements":false,"visualenhancements_reply":false,"visualenhancements_pageframe":false},"wgDiscussionToolsFallbackEditMode":"visual","wgULSPosition":"personal","wgULSisCompactLinksEnabled":true,"wgVector2022LanguageInHeader":false,"wgULSisLanguageSelectorEmpty":false,"wgWikibaseItemId":"Q8614470","wgCheckUserClientHintsHeadersJsApi":["brands","architecture", "bitness","fullVersionList","mobile","model","platform","platformVersion"]};RLSTATE={"ext.globalCssJs.user.styles":"ready","site.styles":"ready","user.styles":"ready","ext.globalCssJs.user":"ready","user":"ready","user.options":"loading","ext.translate.tag.languages":"ready","ext.pygments":"ready","ext.math.styles":"ready","ext.cite.styles":"ready","ext.discussionTools.init.styles":"ready","oojs-ui-core.styles":"ready","oojs-ui.styles.indicators":"ready","mediawiki.widgets.styles":"ready","oojs-ui-core.icons":"ready","skins.vector.search.codex.styles":"ready","skins.vector.styles":"ready","skins.vector.icons":"ready","jquery.makeCollapsible.styles":"ready","ext.translate.edit.documentation.styles":"ready","ext.translate":"ready","ext.wikimediamessages.styles":"ready","ext.visualEditor.desktopArticleTarget.noscript":"ready","ext.uls.pt":"ready","wikibase.client.init":"ready","ext.wikimediaBadges":"ready"};RLPAGEMODULES=["mediawiki.action.view.redirect","ext.pygments.view", "ext.cite.ux-enhancements","mediawiki.page.media","site","mediawiki.page.ready","jquery.makeCollapsible","mediawiki.toc","skins.vector.js","ext.centralNotice.geoIP","ext.centralNotice.startUp","ext.translate.pagetranslation.uls","ext.urlShortener.toolbar","ext.centralauth.centralautologin","mmv.bootstrap","ext.visualEditor.desktopArticleTarget.init","ext.visualEditor.targetLoader","ext.echo.centralauth","ext.discussionTools.init","ext.eventLogging","ext.wikimediaEvents","ext.navigationTiming","ext.uls.compactlinks","ext.uls.interface","wikibase.client.vector-2022","ext.checkUser.clientHints","wikibase.sidebar.tracking"];</script> <script>(RLQ=window.RLQ||[]).push(function(){mw.loader.impl(function(){return["user.options@12s5i",function($,jQuery,require,module){mw.user.tokens.set({"patrolToken":"+\\","watchToken":"+\\","csrfToken":"+\\"}); }];});});</script> <link rel="stylesheet" href="/w/load.php?lang=en&modules=ext.cite.styles%7Cext.discussionTools.init.styles%7Cext.math.styles%7Cext.pygments%2Ctranslate%2CwikimediaBadges%7Cext.translate.edit.documentation.styles%7Cext.translate.tag.languages%7Cext.uls.pt%7Cext.visualEditor.desktopArticleTarget.noscript%7Cext.wikimediamessages.styles%7Cjquery.makeCollapsible.styles%7Cmediawiki.widgets.styles%7Coojs-ui-core.icons%2Cstyles%7Coojs-ui.styles.indicators%7Cskins.vector.icons%2Cstyles%7Cskins.vector.search.codex.styles%7Cwikibase.client.init&only=styles&skin=vector-2022"> <script async="" src="/w/load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector-2022"></script> <meta name="ResourceLoaderDynamicStyles" content=""> <link rel="stylesheet" href="/w/load.php?lang=en&modules=site.styles&only=styles&skin=vector-2022"> <meta name="generator" content="MediaWiki 1.44.0-wmf.5"> <meta name="referrer" content="origin"> <meta name="referrer" content="origin-when-cross-origin"> <meta name="robots" content="max-image-preview:standard"> <meta name="format-detection" content="telephone=no"> <meta name="viewport" content="width=1120"> <meta property="og:site_name" content="MediaWiki"> <meta property="og:title" content="Help:Extension:ParserFunctions - MediaWiki"> <meta property="og:type" content="website"> <link rel="preconnect" href="//upload.wikimedia.org"> <link rel="alternate" media="only screen and (max-width: 640px)" href="//m.mediawiki.org/wiki/Help:Extension:ParserFunctions#ifexist"> <link rel="apple-touch-icon" href="/static/apple-touch/mediawiki.png"> <link rel="icon" href="/static/favicon/mediawiki.ico"> <link rel="search" type="application/opensearchdescription+xml" href="/w/rest.php/v1/search" title="MediaWiki (en)"> <link rel="EditURI" type="application/rsd+xml" href="//www.mediawiki.org/w/api.php?action=rsd"> <link rel="canonical" href="https://www.mediawiki.org/wiki/Help:Extension:ParserFunctions#ifexist"> <link rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/"> <link rel="alternate" type="application/atom+xml" title="MediaWiki Atom feed" href="/w/index.php?title=Special:RecentChanges&feed=atom"> <link rel="dns-prefetch" href="//meta.wikimedia.org" /> <link rel="dns-prefetch" href="//login.wikimedia.org"> </head> <body class="ext-discussiontools-replytool-enabled ext-discussiontools-newtopictool-enabled ext-discussiontools-sourcemodetoolbar-enabled skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-12 ns-subject page-Help_Extension_ParserFunctions rootpage-Help_Extension_ParserFunctions skin-vector-2022 action-view"><a class="mw-jump-link" href="#bodyContent">Jump to content</a> <div class="vector-header-container"> <header class="vector-header mw-header"> <div class="vector-header-start"> <nav class="vector-main-menu-landmark" aria-label="Site"> <div id="vector-main-menu-dropdown" class="vector-dropdown vector-main-menu-dropdown vector-button-flush-left vector-button-flush-right" > <input type="checkbox" id="vector-main-menu-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-main-menu-dropdown" class="vector-dropdown-checkbox " aria-label="Main menu" > <label id="vector-main-menu-dropdown-label" for="vector-main-menu-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-menu mw-ui-icon-wikimedia-menu"></span> <span class="vector-dropdown-label-text">Main menu</span> </label> <div class="vector-dropdown-content"> <div id="vector-main-menu-unpinned-container" class="vector-unpinned-container"> <div id="vector-main-menu" class="vector-main-menu vector-pinnable-element"> <div class="vector-pinnable-header vector-main-menu-pinnable-header vector-pinnable-header-unpinned" data-feature-name="main-menu-pinned" data-pinnable-element-id="vector-main-menu" data-pinned-container-id="vector-main-menu-pinned-container" data-unpinned-container-id="vector-main-menu-unpinned-container" > <div class="vector-pinnable-header-label">Main menu</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-main-menu.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-main-menu.unpin">hide</button> </div> <div id="p-navigation" class="vector-menu mw-portlet mw-portlet-navigation" > <div class="vector-menu-heading"> Navigation </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-mainpage-description" class="mw-list-item"><a href="/wiki/MediaWiki" title="Visit the main page [z]" accesskey="z"><span>Main page</span></a></li><li id="n-mw-download" class="mw-list-item"><a href="/wiki/Download"><span>Get MediaWiki</span></a></li><li id="n-mw-extensions" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Category:Extensions"><span>Get extensions</span></a></li><li id="n-blog-text" class="mw-list-item"><a href="https://techblog.wikimedia.org/"><span>Tech blog</span></a></li><li id="n-mw-contribute" class="mw-list-item"><a href="/wiki/Special:MyLanguage/How_to_contribute"><span>Contribute</span></a></li> </ul> </div> </div> <div id="p-support" class="vector-menu mw-portlet mw-portlet-support" > <div class="vector-menu-heading"> Support </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-help" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Help:Contents" title="The place to find out"><span>User help</span></a></li><li id="n-mw-faq" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Manual:FAQ"><span>FAQ</span></a></li><li id="n-mw-manual" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Manual:Contents"><span>Technical manual</span></a></li><li id="n-mw-supportdesk" class="mw-list-item"><a href="/wiki/Project:Support_desk"><span>Support desk</span></a></li><li id="n-mw-communication" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Communication"><span>Communication</span></a></li> </ul> </div> </div> <div id="p-development" class="vector-menu mw-portlet mw-portlet-development" > <div class="vector-menu-heading"> Development </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-mw-developerportal" class="mw-list-item"><a href="https://developer.wikimedia.org/"><span>Developer portal</span></a></li><li id="n-svn-statistics" class="mw-list-item"><a href="/wiki/Development_statistics"><span>Code statistics</span></a></li> </ul> </div> </div> <div id="p-mediawiki.org" class="vector-menu mw-portlet mw-portlet-mediawiki_org" > <div class="vector-menu-heading"> mediawiki.org </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-portal" class="mw-list-item"><a href="/wiki/Project:Help" title="About the project, what you can do, where to find things"><span>Community portal</span></a></li><li id="n-recentchanges" class="mw-list-item"><a href="/wiki/Special:RecentChanges" title="A list of recent changes in the wiki [r]" accesskey="r"><span>Recent changes</span></a></li><li id="n-mw-translate" class="mw-list-item"><a href="/wiki/Special:LanguageStats"><span>Translate content</span></a></li><li id="n-randompage" class="mw-list-item"><a href="/wiki/Special:Random" title="Load a random page [x]" accesskey="x"><span>Random page</span></a></li><li id="n-mw-discussion" class="mw-list-item"><a href="/wiki/Project:Village_Pump"><span>Village pump</span></a></li><li id="n-Sandboxlink-portlet-label" class="mw-list-item"><a href="/wiki/Project:Sandbox"><span>Sandbox</span></a></li> </ul> </div> </div> <div id="p-lang" class="vector-menu mw-portlet mw-portlet-lang" > <div class="vector-menu-heading"> In other languages </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li class="interlanguage-link interwiki-de mw-list-item"><a href="https://de.wikipedia.org/wiki/Hilfe:Vorlagenprogrammierung" title="Hilfe:Vorlagenprogrammierung – German" lang="de" hreflang="de" data-title="Hilfe:Vorlagenprogrammierung" data-language-autonym="Deutsch" data-language-local-name="German" class="interlanguage-link-target"><span>Deutsch</span></a></li><li class="interlanguage-link interwiki-dsb mw-list-item"><a href="https://dsb.wikipedia.org/wiki/Pomoc:P%C5%9Bed%C5%82ogowe_programowanje" title="Pomoc:Pśedłogowe programowanje – Lower Sorbian" lang="dsb" hreflang="dsb" data-title="Pomoc:Pśedłogowe programowanje" data-language-autonym="Dolnoserbski" data-language-local-name="Lower Sorbian" class="interlanguage-link-target"><span>Dolnoserbski</span></a></li><li class="interlanguage-link interwiki-en mw-list-item"><a href="https://en.wikipedia.org/wiki/Help:Conditional_expressions" title="Help:Conditional expressions – English" lang="en" hreflang="en" data-title="Help:Conditional expressions" data-language-autonym="English" data-language-local-name="English" class="interlanguage-link-target"><span>English</span></a></li><li class="interlanguage-link interwiki-fr mw-list-item"><a href="https://fr.wikipedia.org/wiki/Aide:Fonctions_parseur" title="Aide:Fonctions parseur – French" lang="fr" hreflang="fr" data-title="Aide:Fonctions parseur" data-language-autonym="Français" data-language-local-name="French" class="interlanguage-link-target"><span>Français</span></a></li><li class="interlanguage-link interwiki-he mw-list-item"><a href="https://he.wikipedia.org/wiki/%D7%A2%D7%96%D7%A8%D7%94:%D7%94%D7%95%D7%A8%D7%90%D7%95%D7%AA_%D7%AA%D7%A0%D7%90%D7%99" title="עזרה:הוראות תנאי – Hebrew" lang="he" hreflang="he" data-title="עזרה:הוראות תנאי" data-language-autonym="עברית" data-language-local-name="Hebrew" class="interlanguage-link-target"><span>עברית</span></a></li><li class="interlanguage-link interwiki-hr mw-list-item"><a href="https://hr.wikipedia.org/wiki/Pomo%C4%87:Funkcije_parsera" title="Pomoć:Funkcije parsera – Croatian" lang="hr" hreflang="hr" data-title="Pomoć:Funkcije parsera" data-language-autonym="Hrvatski" data-language-local-name="Croatian" class="interlanguage-link-target"><span>Hrvatski</span></a></li><li class="interlanguage-link interwiki-hsb mw-list-item"><a href="https://hsb.wikipedia.org/wiki/Pomoc:P%C5%99ed%C5%82ohowe_programowanje" title="Pomoc:Předłohowe programowanje – Upper Sorbian" lang="hsb" hreflang="hsb" data-title="Pomoc:Předłohowe programowanje" data-language-autonym="Hornjoserbsce" data-language-local-name="Upper Sorbian" class="interlanguage-link-target"><span>Hornjoserbsce</span></a></li><li class="interlanguage-link interwiki-id mw-list-item"><a href="https://id.wikipedia.org/wiki/Bantuan:Ungkapan_bersyarat" title="Bantuan:Ungkapan bersyarat – Indonesian" lang="id" hreflang="id" data-title="Bantuan:Ungkapan bersyarat" data-language-autonym="Bahasa Indonesia" data-language-local-name="Indonesian" class="interlanguage-link-target"><span>Bahasa Indonesia</span></a></li><li class="interlanguage-link interwiki-inh mw-list-item"><a href="https://inh.wikipedia.org/wiki/%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8:%D0%9F%D0%B0%D1%80%D1%81%D0%B5%D1%80%D0%B0_%D1%84%D1%83%D0%BD%D0%BA%D1%86%D0%B5%D1%88" title="Википеди:Парсера функцеш – Ingush" lang="inh" hreflang="inh" data-title="Википеди:Парсера функцеш" data-language-autonym="ГӀалгӀай" data-language-local-name="Ingush" class="interlanguage-link-target"><span>ГӀалгӀай</span></a></li><li class="interlanguage-link interwiki-is mw-list-item"><a href="https://is.wikipedia.org/wiki/Hj%C3%A1lp:%C3%9E%C3%A1ttunar_a%C3%B0ger%C3%B0ir" title="Hjálp:Þáttunar aðgerðir – Icelandic" lang="is" hreflang="is" data-title="Hjálp:Þáttunar aðgerðir" data-language-autonym="Íslenska" data-language-local-name="Icelandic" class="interlanguage-link-target"><span>Íslenska</span></a></li><li class="interlanguage-link interwiki-it mw-list-item"><a href="https://it.wikipedia.org/wiki/Aiuto:Funzioni_parser" title="Aiuto:Funzioni parser – Italian" lang="it" hreflang="it" data-title="Aiuto:Funzioni parser" data-language-autonym="Italiano" data-language-local-name="Italian" class="interlanguage-link-target"><span>Italiano</span></a></li><li class="interlanguage-link interwiki-ja mw-list-item"><a href="https://ja.wikipedia.org/wiki/Help:%E6%9D%A1%E4%BB%B6%E6%96%87" title="Help:条件文 – Japanese" lang="ja" hreflang="ja" data-title="Help:条件文" data-language-autonym="日本語" data-language-local-name="Japanese" class="interlanguage-link-target"><span>日本語</span></a></li><li class="interlanguage-link interwiki-lb mw-list-item"><a href="https://lb.wikipedia.org/wiki/H%C3%ABllef:Schablouneprogramm%C3%A9ierung" title="Hëllef:Schablouneprogramméierung – Luxembourgish" lang="lb" hreflang="lb" data-title="Hëllef:Schablouneprogramméierung" data-language-autonym="Lëtzebuergesch" data-language-local-name="Luxembourgish" class="interlanguage-link-target"><span>Lëtzebuergesch</span></a></li><li class="interlanguage-link interwiki-nl mw-list-item"><a href="https://nl.wikipedia.org/wiki/Help:Parserfuncties" title="Help:Parserfuncties – Dutch" lang="nl" hreflang="nl" data-title="Help:Parserfuncties" data-language-autonym="Nederlands" data-language-local-name="Dutch" class="interlanguage-link-target"><span>Nederlands</span></a></li><li class="interlanguage-link interwiki-pl mw-list-item"><a href="https://pl.wikipedia.org/wiki/Pomoc:Funkcje_parsera" title="Pomoc:Funkcje parsera – Polish" lang="pl" hreflang="pl" data-title="Pomoc:Funkcje parsera" data-language-autonym="Polski" data-language-local-name="Polish" class="interlanguage-link-target"><span>Polski</span></a></li><li class="interlanguage-link interwiki-pt mw-list-item"><a href="https://pt.wikipedia.org/wiki/Ajuda:Fun%C3%A7%C3%B5es_sint%C3%A1ticas" title="Ajuda:Funções sintáticas – Portuguese" lang="pt" hreflang="pt" data-title="Ajuda:Funções sintáticas" data-language-autonym="Português" data-language-local-name="Portuguese" class="interlanguage-link-target"><span>Português</span></a></li><li class="interlanguage-link interwiki-ru mw-list-item"><a href="https://ru.wikipedia.org/wiki/%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%8F:%D0%A4%D1%83%D0%BD%D0%BA%D1%86%D0%B8%D0%B8_%D0%BF%D0%B0%D1%80%D1%81%D0%B5%D1%80%D0%B0" title="Википедия:Функции парсера – Russian" lang="ru" hreflang="ru" data-title="Википедия:Функции парсера" data-language-autonym="Русский" data-language-local-name="Russian" class="interlanguage-link-target"><span>Русский</span></a></li><li class="interlanguage-link interwiki-simple mw-list-item"><a href="https://simple.wikipedia.org/wiki/Help:Conditional_expressions" title="Help:Conditional expressions – Simple English" lang="en-simple" hreflang="en-simple" data-title="Help:Conditional expressions" data-language-autonym="Simple English" data-language-local-name="Simple English" class="interlanguage-link-target"><span>Simple English</span></a></li><li class="interlanguage-link interwiki-sl mw-list-item"><a href="https://sl.wikipedia.org/wiki/Pomo%C4%8D:ParserFunctions" title="Pomoč:ParserFunctions – Slovenian" lang="sl" hreflang="sl" data-title="Pomoč:ParserFunctions" data-language-autonym="Slovenščina" data-language-local-name="Slovenian" class="interlanguage-link-target"><span>Slovenščina</span></a></li><li class="interlanguage-link interwiki-uk mw-list-item"><a href="https://uk.wikipedia.org/wiki/%D0%94%D0%BE%D0%B2%D1%96%D0%B4%D0%BA%D0%B0:%D0%A4%D1%83%D0%BD%D0%BA%D1%86%D1%96%D1%97_%D0%BF%D0%B0%D1%80%D1%81%D0%B5%D1%80%D0%B0" title="Довідка:Функції парсера – Ukrainian" lang="uk" hreflang="uk" data-title="Довідка:Функції парсера" data-language-autonym="Українська" data-language-local-name="Ukrainian" class="interlanguage-link-target"><span>Українська</span></a></li><li class="interlanguage-link interwiki-ur mw-list-item"><a href="https://ur.wikipedia.org/wiki/%D9%85%D8%B9%D8%A7%D9%88%D9%86%D8%AA:%D8%B4%D8%B1%D8%B7%DB%8C%DB%81_%D8%AC%D9%85%D9%84%DB%92" title="معاونت:شرطیہ جملے – Urdu" lang="ur" hreflang="ur" data-title="معاونت:شرطیہ جملے" data-language-autonym="اردو" data-language-local-name="Urdu" class="interlanguage-link-target"><span>اردو</span></a></li><li class="interlanguage-link interwiki-vi mw-list-item"><a href="https://vi.wikipedia.org/wiki/Tr%E1%BB%A3_gi%C3%BAp:T%C3%ADnh_to%C3%A1n" title="Trợ giúp:Tính toán – Vietnamese" lang="vi" hreflang="vi" data-title="Trợ giúp:Tính toán" data-language-autonym="Tiếng Việt" data-language-local-name="Vietnamese" class="interlanguage-link-target"><span>Tiếng Việt</span></a></li><li class="interlanguage-link interwiki-yi mw-list-item"><a href="https://yi.wikipedia.org/wiki/%D7%B0%D7%99%D7%A7%D7%99%D7%A4%D6%BC%D7%A2%D7%93%D7%99%D7%A2:%D7%A4%D7%90%D7%A8%D7%96%D7%A2%D7%A8_%D7%A4%D7%95%D7%A0%D7%A7%D7%A6%D7%99%D7%90%D7%A0%D7%A2%D7%9F" title="װיקיפּעדיע:פארזער פונקציאנען – Yiddish" lang="yi" hreflang="yi" data-title="װיקיפּעדיע:פארזער פונקציאנען" data-language-autonym="ייִדיש" data-language-local-name="Yiddish" class="interlanguage-link-target"><span>ייִדיש</span></a></li><li class="interlanguage-link interwiki-zh mw-list-item"><a href="https://zh.wikipedia.org/wiki/Help:%E8%A7%A3%E6%9E%90%E5%99%A8%E5%87%BD%E6%95%B0" title="Help:解析器函数 – Chinese" lang="zh" hreflang="zh" data-title="Help:解析器函数" data-language-autonym="中文" data-language-local-name="Chinese" class="interlanguage-link-target"><span>中文</span></a></li> </ul> <div class="after-portlet after-portlet-lang"><span class="wb-langlinks-edit wb-langlinks-link"><a href="https://www.wikidata.org/wiki/Special:EntityPage/Q8614470#sitelinks-wikipedia" title="Edit interlanguage links" class="wbc-editpage">Edit links</a></span></div> </div> </div> </div> </div> </div> </div> </nav> <a href="/wiki/MediaWiki" class="mw-logo"> <img class="mw-logo-icon" src="/static/images/icons/mediawikiwiki.svg" alt="" aria-hidden="true" height="50" width="50"> <span class="mw-logo-container skin-invert"> <img class="mw-logo-wordmark" alt="MediaWiki" src="/static/images/mobile/copyright/mediawikiwiki-wordmark.svg" style="width: 7.5em; height: 1.125em;"> </span> </a> </div> <div class="vector-header-end"> <div id="p-search" role="search" class="vector-search-box-vue vector-search-box-collapses vector-search-box-show-thumbnail vector-search-box-auto-expand-width vector-search-box"> <a href="/wiki/Special:Search" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only search-toggle" title="Search MediaWiki [f]" accesskey="f"><span class="vector-icon mw-ui-icon-search mw-ui-icon-wikimedia-search"></span> <span>Search</span> </a> <div class="vector-typeahead-search-container"> <div class="cdx-typeahead-search cdx-typeahead-search--show-thumbnail cdx-typeahead-search--auto-expand-width"> <form action="/w/index.php" id="searchform" class="cdx-search-input cdx-search-input--has-end-button"> <div id="simpleSearch" class="cdx-search-input__input-wrapper" data-search-loc="header-moved"> <div class="cdx-text-input cdx-text-input--has-start-icon"> <input class="cdx-text-input__input" type="search" name="search" placeholder="Search MediaWiki" aria-label="Search MediaWiki" autocapitalize="sentences" title="Search MediaWiki [f]" accesskey="f" id="searchInput" > <span class="cdx-text-input__icon cdx-text-input__start-icon"></span> </div> <input type="hidden" name="title" value="Special:Search"> </div> <button class="cdx-button cdx-search-input__end-button">Search</button> </form> </div> </div> </div> <nav class="vector-user-links vector-user-links-wide" aria-label="Personal tools"> <div class="vector-user-links-main"> <div id="p-vector-user-menu-preferences" class="vector-menu mw-portlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-uls" class="mw-list-item active user-links-collapsible-item"><a data-mw="interface" href="#" class="uls-trigger cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet"><span class="vector-icon mw-ui-icon-wikimedia-language mw-ui-icon-wikimedia-wikimedia-language"></span> <span>English</span></a> </li> </ul> </div> </div> <div id="p-vector-user-menu-userpage" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <nav class="vector-appearance-landmark" aria-label="Appearance"> <div id="vector-appearance-dropdown" class="vector-dropdown " title="Change the appearance of the page's font size, width, and color" > <input type="checkbox" id="vector-appearance-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-appearance-dropdown" class="vector-dropdown-checkbox " aria-label="Appearance" > <label id="vector-appearance-dropdown-label" for="vector-appearance-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-appearance mw-ui-icon-wikimedia-appearance"></span> <span class="vector-dropdown-label-text">Appearance</span> </label> <div class="vector-dropdown-content"> <div id="vector-appearance-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <div id="p-vector-user-menu-notifications" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <div id="p-vector-user-menu-overflow" class="vector-menu mw-portlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="https://donate.wikimedia.org/?wmf_source=donate&wmf_medium=sidebar&wmf_campaign=www.mediawiki.org&uselang=en" class=""><span>Donate</span></a> </li> <li id="pt-createaccount-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="/w/index.php?title=Special:CreateAccount&returnto=Help%3AExtension%3AParserFunctions" title="You are encouraged to create an account and log in; however, it is not mandatory" class=""><span>Create account</span></a> </li> <li id="pt-login-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="/w/index.php?title=Special:UserLogin&returnto=Help%3AExtension%3AParserFunctions" title="You are encouraged to log in; however, it is not mandatory [o]" accesskey="o" class=""><span>Log in</span></a> </li> </ul> </div> </div> </div> <div id="vector-user-links-dropdown" class="vector-dropdown vector-user-menu vector-button-flush-right vector-user-menu-logged-out" title="More options" > <input type="checkbox" id="vector-user-links-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-user-links-dropdown" class="vector-dropdown-checkbox " aria-label="Personal tools" > <label id="vector-user-links-dropdown-label" for="vector-user-links-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-ellipsis mw-ui-icon-wikimedia-ellipsis"></span> <span class="vector-dropdown-label-text">Personal tools</span> </label> <div class="vector-dropdown-content"> <div id="p-personal" class="vector-menu mw-portlet mw-portlet-personal user-links-collapsible-item" title="User menu" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport" class="user-links-collapsible-item mw-list-item"><a href="https://donate.wikimedia.org/?wmf_source=donate&wmf_medium=sidebar&wmf_campaign=www.mediawiki.org&uselang=en"><span>Donate</span></a></li><li id="pt-createaccount" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=Special:CreateAccount&returnto=Help%3AExtension%3AParserFunctions" title="You are encouraged to create an account and log in; however, it is not mandatory"><span class="vector-icon mw-ui-icon-userAdd mw-ui-icon-wikimedia-userAdd"></span> <span>Create account</span></a></li><li id="pt-login" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=Special:UserLogin&returnto=Help%3AExtension%3AParserFunctions" title="You are encouraged to log in; however, it is not mandatory [o]" accesskey="o"><span class="vector-icon mw-ui-icon-logIn mw-ui-icon-wikimedia-logIn"></span> <span>Log in</span></a></li> </ul> </div> </div> <div id="p-user-menu-anon-editor" class="vector-menu mw-portlet mw-portlet-user-menu-anon-editor" > <div class="vector-menu-heading"> Pages for logged out editors <a href="/wiki/Help:Introduction" aria-label="Learn more about editing"><span>learn more</span></a> </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-anoncontribs" class="mw-list-item"><a href="/wiki/Special:MyContributions" title="A list of edits made from this IP address [y]" accesskey="y"><span>Contributions</span></a></li><li id="pt-anontalk" class="mw-list-item"><a href="/wiki/Special:MyTalk" title="Discussion about edits from this IP address [n]" accesskey="n"><span>Talk</span></a></li> </ul> </div> </div> </div> </div> </nav> </div> </header> </div> <div class="mw-page-container"> <div class="mw-page-container-inner"> <div class="vector-sitenotice-container"> <div id="siteNotice"><!-- CentralNotice --></div> </div> <div class="vector-column-start"> <div class="vector-main-menu-container"> <div id="mw-navigation"> <nav id="mw-panel" class="vector-main-menu-landmark" aria-label="Site"> <div id="vector-main-menu-pinned-container" class="vector-pinned-container"> </div> </nav> </div> </div> <div class="vector-sticky-pinned-container"> <nav id="mw-panel-toc" aria-label="Contents" data-event-name="ui.sidebar-toc" class="mw-table-of-contents-container vector-toc-landmark"> <div id="vector-toc-pinned-container" class="vector-pinned-container"> <div id="vector-toc" class="vector-toc vector-pinnable-element"> <div class="vector-pinnable-header vector-toc-pinnable-header vector-pinnable-header-pinned" data-feature-name="toc-pinned" data-pinnable-element-id="vector-toc" > <h2 class="vector-pinnable-header-label">Contents</h2> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-toc.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-toc.unpin">hide</button> </div> <ul class="vector-toc-contents" id="mw-panel-toc-list"> <li id="toc-mw-content-text" class="vector-toc-list-item vector-toc-level-1"> <a href="#" class="vector-toc-link"> <div class="vector-toc-text">Beginning</div> </a> </li> <li id="toc-#expr" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="##expr"> <div class="vector-toc-text"> <span class="vector-toc-numb">1</span> <span>#expr</span> </div> </a> <button aria-controls="toc-#expr-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Toggle #expr subsection</span> </button> <ul id="toc-#expr-sublist" class="vector-toc-list"> <li id="toc-Rounding" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Rounding"> <div class="vector-toc-text"> <span class="vector-toc-numb">1.1</span> <span>Rounding</span> </div> </a> <ul id="toc-Rounding-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Strings" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Strings"> <div class="vector-toc-text"> <span class="vector-toc-numb">1.2</span> <span>Strings</span> </div> </a> <ul id="toc-Strings-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-#if" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="##if"> <div class="vector-toc-text"> <span class="vector-toc-numb">2</span> <span>#if</span> </div> </a> <ul id="toc-#if-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-#ifeq" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="##ifeq"> <div class="vector-toc-text"> <span class="vector-toc-numb">3</span> <span>#ifeq</span> </div> </a> <ul id="toc-#ifeq-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-#iferror" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="##iferror"> <div class="vector-toc-text"> <span class="vector-toc-numb">4</span> <span>#iferror</span> </div> </a> <ul id="toc-#iferror-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-#ifexpr" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="##ifexpr"> <div class="vector-toc-text"> <span class="vector-toc-numb">5</span> <span>#ifexpr</span> </div> </a> <ul id="toc-#ifexpr-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-#ifexist" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="##ifexist"> <div class="vector-toc-text"> <span class="vector-toc-numb">6</span> <span>#ifexist</span> </div> </a> <button aria-controls="toc-#ifexist-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Toggle #ifexist subsection</span> </button> <ul id="toc-#ifexist-sublist" class="vector-toc-list"> <li id="toc-ifexist_limits" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#ifexist_limits"> <div class="vector-toc-text"> <span class="vector-toc-numb">6.1</span> <span>ifexist limits</span> </div> </a> <ul id="toc-ifexist_limits-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-ifexist_and_wanted_pages" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#ifexist_and_wanted_pages"> <div class="vector-toc-text"> <span class="vector-toc-numb">6.2</span> <span>ifexist and wanted pages</span> </div> </a> <ul id="toc-ifexist_and_wanted_pages-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-#rel2abs" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="##rel2abs"> <div class="vector-toc-text"> <span class="vector-toc-numb">7</span> <span>#rel2abs</span> </div> </a> <ul id="toc-#rel2abs-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-#switch" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="##switch"> <div class="vector-toc-text"> <span class="vector-toc-numb">8</span> <span>#switch</span> </div> </a> <button aria-controls="toc-#switch-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Toggle #switch subsection</span> </button> <ul id="toc-#switch-sublist" class="vector-toc-list"> <li id="toc-Default" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Default"> <div class="vector-toc-text"> <span class="vector-toc-numb">8.1</span> <span>Default</span> </div> </a> <ul id="toc-Default-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Grouping_results" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Grouping_results"> <div class="vector-toc-text"> <span class="vector-toc-numb">8.2</span> <span>Grouping results</span> </div> </a> <ul id="toc-Grouping_results-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Use_with_parameters" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Use_with_parameters"> <div class="vector-toc-text"> <span class="vector-toc-numb">8.3</span> <span>Use with parameters</span> </div> </a> <ul id="toc-Use_with_parameters-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Comparison_behavior" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Comparison_behavior"> <div class="vector-toc-text"> <span class="vector-toc-numb">8.4</span> <span>Comparison behavior</span> </div> </a> <ul id="toc-Comparison_behavior-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Raw_equal_signs" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Raw_equal_signs"> <div class="vector-toc-text"> <span class="vector-toc-numb">8.5</span> <span>Raw equal signs</span> </div> </a> <ul id="toc-Raw_equal_signs-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Replacing_#ifeq" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Replacing_#ifeq"> <div class="vector-toc-text"> <span class="vector-toc-numb">8.6</span> <span>Replacing #ifeq</span> </div> </a> <ul id="toc-Replacing_#ifeq-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-#time" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="##time"> <div class="vector-toc-text"> <span class="vector-toc-numb">9</span> <span>#time</span> </div> </a> <button aria-controls="toc-#time-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Toggle #time subsection</span> </button> <ul id="toc-#time-sublist" class="vector-toc-list"> <li id="toc-Time_Zone_issue" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Time_Zone_issue"> <div class="vector-toc-text"> <span class="vector-toc-numb">9.1</span> <span>Time Zone issue</span> </div> </a> <ul id="toc-Time_Zone_issue-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-#time_format_like_in_signatures" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="##time_format_like_in_signatures"> <div class="vector-toc-text"> <span class="vector-toc-numb">9.2</span> <span>#time format like in signatures</span> </div> </a> <ul id="toc-#time_format_like_in_signatures-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-#timel" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="##timel"> <div class="vector-toc-text"> <span class="vector-toc-numb">10</span> <span>#timel</span> </div> </a> <ul id="toc-#timel-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-#timef" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="##timef"> <div class="vector-toc-text"> <span class="vector-toc-numb">11</span> <span>#timef</span> </div> </a> <ul id="toc-#timef-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-#timefl" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="##timefl"> <div class="vector-toc-text"> <span class="vector-toc-numb">12</span> <span>#timefl</span> </div> </a> <ul id="toc-#timefl-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-#titleparts" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="##titleparts"> <div class="vector-toc-text"> <span class="vector-toc-numb">13</span> <span>#titleparts</span> </div> </a> <ul id="toc-#titleparts-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-String_functions" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#String_functions"> <div class="vector-toc-text"> <span class="vector-toc-numb">14</span> <span>String functions</span> </div> </a> <ul id="toc-String_functions-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-General_points" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#General_points"> <div class="vector-toc-text"> <span class="vector-toc-numb">15</span> <span>General points</span> </div> </a> <button aria-controls="toc-General_points-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Toggle General points subsection</span> </button> <ul id="toc-General_points-sublist" class="vector-toc-list"> <li id="toc-Substitution" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Substitution"> <div class="vector-toc-text"> <span class="vector-toc-numb">15.1</span> <span>Substitution</span> </div> </a> <ul id="toc-Substitution-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Redirects" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Redirects"> <div class="vector-toc-text"> <span class="vector-toc-numb">15.2</span> <span>Redirects</span> </div> </a> <ul id="toc-Redirects-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Escaping_pipe_characters_in_tables" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Escaping_pipe_characters_in_tables"> <div class="vector-toc-text"> <span class="vector-toc-numb">15.3</span> <span>Escaping pipe characters in tables</span> </div> </a> <ul id="toc-Escaping_pipe_characters_in_tables-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Stripping_whitespace" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Stripping_whitespace"> <div class="vector-toc-text"> <span class="vector-toc-numb">15.4</span> <span>Stripping whitespace</span> </div> </a> <ul id="toc-Stripping_whitespace-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-Other_parser_functions" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#Other_parser_functions"> <div class="vector-toc-text"> <span class="vector-toc-numb">16</span> <span>Other parser functions</span> </div> </a> <button aria-controls="toc-Other_parser_functions-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Toggle Other parser functions subsection</span> </button> <ul id="toc-Other_parser_functions-sublist" class="vector-toc-list"> <li id="toc-Case_conversion_functions" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Case_conversion_functions"> <div class="vector-toc-text"> <span class="vector-toc-numb">16.1</span> <span>Case conversion functions</span> </div> </a> <ul id="toc-Case_conversion_functions-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Encoding_functions" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Encoding_functions"> <div class="vector-toc-text"> <span class="vector-toc-numb">16.2</span> <span>Encoding functions</span> </div> </a> <ul id="toc-Encoding_functions-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Anchor_encoding" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Anchor_encoding"> <div class="vector-toc-text"> <span class="vector-toc-numb">16.3</span> <span>Anchor encoding</span> </div> </a> <ul id="toc-Anchor_encoding-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Padding_functions" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Padding_functions"> <div class="vector-toc-text"> <span class="vector-toc-numb">16.4</span> <span>Padding functions</span> </div> </a> <ul id="toc-Padding_functions-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Formatting_functions" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Formatting_functions"> <div class="vector-toc-text"> <span class="vector-toc-numb">16.5</span> <span>Formatting functions</span> </div> </a> <ul id="toc-Formatting_functions-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-See_also" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#See_also"> <div class="vector-toc-text"> <span class="vector-toc-numb">17</span> <span>See also</span> </div> </a> <ul id="toc-See_also-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-References" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#References"> <div class="vector-toc-text"> <span class="vector-toc-numb">18</span> <span>References</span> </div> </a> <ul id="toc-References-sublist" class="vector-toc-list"> </ul> </li> </ul> </div> </div> </nav> </div> </div> <div class="mw-content-container"> <main id="content" class="mw-body"> <header class="mw-body-header vector-page-titlebar"> <nav aria-label="Contents" class="vector-toc-landmark"> <div id="vector-page-titlebar-toc" class="vector-dropdown vector-page-titlebar-toc vector-button-flush-left" > <input type="checkbox" id="vector-page-titlebar-toc-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-page-titlebar-toc" class="vector-dropdown-checkbox " aria-label="Toggle the table of contents" > <label id="vector-page-titlebar-toc-label" for="vector-page-titlebar-toc-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-listBullet mw-ui-icon-wikimedia-listBullet"></span> <span class="vector-dropdown-label-text">Toggle the table of contents</span> </label> <div class="vector-dropdown-content"> <div id="vector-page-titlebar-toc-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <h1 id="firstHeading" class="firstHeading mw-first-heading"><span class="mw-page-title-namespace">Help</span><span class="mw-page-title-separator">:</span><span class="mw-page-title-main">Extension:ParserFunctions</span></h1> <div class="mw-indicators"> </div> </header> <div class="vector-page-toolbar"> <div class="vector-page-toolbar-container"> <div id="left-navigation"> <nav aria-label="Namespaces"> <div id="p-associated-pages" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-associated-pages" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-nstab-help" class="selected vector-tab-noicon mw-list-item"><a href="/wiki/Help:Extension:ParserFunctions" title="View the help page [c]" accesskey="c"><span>Help</span></a></li><li id="ca-talk" class="vector-tab-noicon mw-list-item"><a href="/wiki/Help_talk:Extension:ParserFunctions" rel="discussion" title="Discussion about the content page [t]" accesskey="t"><span>Discussion</span></a></li> </ul> </div> </div> <div id="vector-variants-dropdown" class="vector-dropdown emptyPortlet" > <input type="checkbox" id="vector-variants-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-variants-dropdown" class="vector-dropdown-checkbox " aria-label="Change language variant" > <label id="vector-variants-dropdown-label" for="vector-variants-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true" ><span class="vector-dropdown-label-text">English</span> </label> <div class="vector-dropdown-content"> <div id="p-variants" class="vector-menu mw-portlet mw-portlet-variants emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> </div> </div> </nav> </div> <div id="right-navigation" class="vector-collapsible"> <nav aria-label="Views"> <div id="p-views" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-views" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-view" class="selected vector-tab-noicon mw-list-item"><a href="/wiki/Help:Extension:ParserFunctions"><span>Read</span></a></li><li id="ca-viewsource" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Help:Extension:ParserFunctions&action=edit" title="This page is protected. You can view its source [e]" accesskey="e"><span>View source</span></a></li><li id="ca-history" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Help:Extension:ParserFunctions&action=history" title="Past revisions of this page [h]" accesskey="h"><span>View history</span></a></li> </ul> </div> </div> </nav> <nav class="vector-page-tools-landmark" aria-label="Page tools"> <div id="vector-page-tools-dropdown" class="vector-dropdown vector-page-tools-dropdown" > <input type="checkbox" id="vector-page-tools-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-page-tools-dropdown" class="vector-dropdown-checkbox " aria-label="Tools" > <label id="vector-page-tools-dropdown-label" for="vector-page-tools-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true" ><span class="vector-dropdown-label-text">Tools</span> </label> <div class="vector-dropdown-content"> <div id="vector-page-tools-unpinned-container" class="vector-unpinned-container"> <div id="vector-page-tools" class="vector-page-tools vector-pinnable-element"> <div class="vector-pinnable-header vector-page-tools-pinnable-header vector-pinnable-header-unpinned" data-feature-name="page-tools-pinned" data-pinnable-element-id="vector-page-tools" data-pinned-container-id="vector-page-tools-pinned-container" data-unpinned-container-id="vector-page-tools-unpinned-container" > <div class="vector-pinnable-header-label">Tools</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-page-tools.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-page-tools.unpin">hide</button> </div> <div id="p-cactions" class="vector-menu mw-portlet mw-portlet-cactions emptyPortlet vector-has-collapsible-items" title="More options" > <div class="vector-menu-heading"> Actions </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-more-view" class="selected vector-more-collapsible-item mw-list-item"><a href="/wiki/Help:Extension:ParserFunctions"><span>Read</span></a></li><li id="ca-more-viewsource" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=Help:Extension:ParserFunctions&action=edit"><span>View source</span></a></li><li id="ca-more-history" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=Help:Extension:ParserFunctions&action=history"><span>View history</span></a></li> </ul> </div> </div> <div id="p-tb" class="vector-menu mw-portlet mw-portlet-tb" > <div class="vector-menu-heading"> General </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="t-whatlinkshere" class="mw-list-item"><a href="/wiki/Special:WhatLinksHere/Help:Extension:ParserFunctions" title="A list of all wiki pages that link here [j]" accesskey="j"><span>What links here</span></a></li><li id="t-recentchangeslinked" class="mw-list-item"><a href="/wiki/Special:RecentChangesLinked/Help:Extension:ParserFunctions" rel="nofollow" title="Recent changes in pages linked from this page [k]" accesskey="k"><span>Related changes</span></a></li><li id="t-upload" class="mw-list-item"><a href="//commons.wikimedia.org/wiki/Special:UploadWizard" title="Upload files [u]" accesskey="u"><span>Upload file</span></a></li><li id="t-specialpages" class="mw-list-item"><a href="/wiki/Special:SpecialPages" title="A list of all special pages [q]" accesskey="q"><span>Special pages</span></a></li><li id="t-permalink" class="mw-list-item"><a href="/w/index.php?title=Help:Extension:ParserFunctions&oldid=6816696" title="Permanent link to this revision of this page"><span>Permanent link</span></a></li><li id="t-info" class="mw-list-item"><a href="/w/index.php?title=Help:Extension:ParserFunctions&action=info" title="More information about this page"><span>Page information</span></a></li><li id="t-urlshortener" class="mw-list-item"><a href="/w/index.php?title=Special:UrlShortener&url=https%3A%2F%2Fwww.mediawiki.org%2Fwiki%2FHelp%3AExtension%3AParserFunctions%23ifexist"><span>Get shortened URL</span></a></li><li id="t-urlshortener-qrcode" class="mw-list-item"><a href="/w/index.php?title=Special:QrCode&url=https%3A%2F%2Fwww.mediawiki.org%2Fwiki%2FHelp%3AExtension%3AParserFunctions%23ifexist"><span>Download QR code</span></a></li> </ul> </div> </div> <div id="p-coll-print_export" class="vector-menu mw-portlet mw-portlet-coll-print_export" > <div class="vector-menu-heading"> Print/export </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="coll-create_a_book" class="mw-list-item"><a href="/w/index.php?title=Special:Book&bookcmd=book_creator&referer=Help%3AExtension%3AParserFunctions"><span>Create a book</span></a></li><li id="coll-download-as-rl" class="mw-list-item"><a href="/w/index.php?title=Special:DownloadAsPdf&page=Help%3AExtension%3AParserFunctions&action=show-download-screen"><span>Download as PDF</span></a></li><li id="t-print" class="mw-list-item"><a href="/w/index.php?title=Help:Extension:ParserFunctions&printable=yes" title="Printable version of this page [p]" accesskey="p"><span>Printable version</span></a></li> </ul> </div> </div> <div id="p-wikibase-otherprojects" class="vector-menu mw-portlet mw-portlet-wikibase-otherprojects" > <div class="vector-menu-heading"> In other projects </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li class="wb-otherproject-link wb-otherproject-meta mw-list-item"><a href="https://meta.wikimedia.org/wiki/Help:Parser_function" hreflang="en"><span>Meta-Wiki</span></a></li><li class="wb-otherproject-link wb-otherproject-wikipedia mw-list-item"><a href="https://en.wikipedia.org/wiki/Help:Conditional_expressions" hreflang="en"><span>Wikipedia</span></a></li><li id="t-wikibase" class="wb-otherproject-link wb-otherproject-wikibase-dataitem mw-list-item"><a href="https://www.wikidata.org/wiki/Special:EntityPage/Q8614470" title="Link to connected data repository item [g]" accesskey="g"><span>Wikidata item</span></a></li> </ul> </div> </div> </div> </div> </div> </div> </nav> </div> </div> </div> <div class="vector-column-end"> <div class="vector-sticky-pinned-container"> <nav class="vector-page-tools-landmark" aria-label="Page tools"> <div id="vector-page-tools-pinned-container" class="vector-pinned-container"> </div> </nav> <nav class="vector-appearance-landmark" aria-label="Appearance"> <div id="vector-appearance-pinned-container" class="vector-pinned-container"> <div id="vector-appearance" class="vector-appearance vector-pinnable-element"> <div class="vector-pinnable-header vector-appearance-pinnable-header vector-pinnable-header-pinned" data-feature-name="appearance-pinned" data-pinnable-element-id="vector-appearance" data-pinned-container-id="vector-appearance-pinned-container" data-unpinned-container-id="vector-appearance-unpinned-container" > <div class="vector-pinnable-header-label">Appearance</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-appearance.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-appearance.unpin">hide</button> </div> </div> </div> </nav> </div> </div> <div id="bodyContent" class="vector-body" aria-labelledby="firstHeading" data-mw-ve-target-container> <div class="vector-body-before-content"> <div id="siteSub" class="noprint">From mediawiki.org</div> </div> <div id="contentSub"><div id="mw-content-subtitle"></div></div> <div id="mw-content-text" class="mw-body-content"><div class="mw-pt-translate-header noprint nomobile" dir="ltr" lang="en"><a href="/w/index.php?title=Special:Translate&group=page-Help%3AExtension%3AParserFunctions&action=page&filter=&action_source=translate_page" title="Special:Translate">Translate this page</a></div><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr"><div class="mw-pt-languages noprint navigation-not-searchable" lang="en" dir="ltr"><div class="mw-pt-languages-label">Languages:</div><ul class="mw-pt-languages-list"><li><a href="/wiki/Help:Extension:ParserFunctions/id" class="mw-pt-progress mw-pt-progress--low" title="Bantuan:Ekstensi:ParserFunctions (6% translated)" lang="id" dir="ltr">Bahasa Indonesia</a></li> <li><a href="/wiki/Help:Extension:ParserFunctions/de" class="mw-pt-progress mw-pt-progress--high" title="Hilfe:Erweiterung:ParserFunktionen (95% translated)" lang="de" dir="ltr">Deutsch</a></li> <li><span class="mw-pt-languages-ui mw-pt-languages-selected mw-pt-progress mw-pt-progress--complete" lang="en" dir="ltr">English</span></li> <li><a href="/wiki/Help:Extension:ParserFunctions/lb" class="mw-pt-progress mw-pt-progress--low" title="Hëllef:Erweiderung:ParserFunktiounen (4% translated)" lang="lb" dir="ltr">Lëtzebuergesch</a></li> <li><a href="/wiki/Help:Extension:ParserFunctions/nl" class="mw-pt-progress mw-pt-progress--complete" title="Help extension ParserFunctions (100% translated)" lang="nl" dir="ltr">Nederlands</a></li> <li><a href="/wiki/Help:Extension:ParserFunctions/vi" class="mw-pt-progress mw-pt-progress--med" title="Trợ giúp:Tiện ích mở rộng:ParserFunctions (26% translated)" lang="vi" dir="ltr">Tiếng Việt</a></li> <li><a href="/wiki/Help:Extension:ParserFunctions/tr" class="mw-pt-progress mw-pt-progress--high" title="Help:Extension:ParserFunctions (82% translated)" lang="tr" dir="ltr">Türkçe</a></li> <li><a href="/wiki/Help:Extension:ParserFunctions/yo" class="mw-pt-progress mw-pt-progress--low" title="Help:Extension:ParserFunctions/yo (2% translated)" lang="yo" dir="ltr">Yorùbá</a></li> <li><a href="/wiki/Help:Extension:ParserFunctions/diq" class="mw-pt-progress mw-pt-progress--low" title="Help:Extension:ParserFunctions/diq (2% translated)" lang="diq" dir="ltr">Zazaki</a></li> <li><a href="/wiki/Help:Extension:ParserFunctions/es" class="mw-pt-progress mw-pt-progress--med" title="Ayuda:Extensión:ParserFunctions (48% translated)" lang="es" dir="ltr">español</a></li> <li><a href="/wiki/Help:Extension:ParserFunctions/fr" class="mw-pt-progress mw-pt-progress--high" title="Aide:Extension:Fonctions d'analyse (99% translated)" lang="fr" dir="ltr">français</a></li> <li><a href="/wiki/Help:Extension:ParserFunctions/gl" class="mw-pt-progress mw-pt-progress--med" title="Axuda:Extensión:ParserFunctions (55% translated)" lang="gl" dir="ltr">galego</a></li> <li><a href="/wiki/Help:Extension:ParserFunctions/it" class="mw-pt-progress mw-pt-progress--med" title="Help:Extension:ParserFunctions (24% translated)" lang="it" dir="ltr">italiano</a></li> <li><a href="/wiki/Help:Extension:ParserFunctions/hu" class="mw-pt-progress mw-pt-progress--med" title="Help:Extension:ParserFunctions/hu (36% translated)" lang="hu" dir="ltr">magyar</a></li> <li><a href="/wiki/Help:Extension:ParserFunctions/pl" class="mw-pt-progress mw-pt-progress--med" title="Help:Rozszerzenie:Funkcje parsera (28% translated)" lang="pl" dir="ltr">polski</a></li> <li><a href="/wiki/Help:Extension:ParserFunctions/pt" class="mw-pt-progress mw-pt-progress--med" title="Ajuda:Extensão:Funções do Analisador (38% translated)" lang="pt" dir="ltr">português</a></li> <li><a href="/wiki/Help:Extension:ParserFunctions/pt-br" class="mw-pt-progress mw-pt-progress--high" title="Ajuda:Extensão:ParserFunctions (94% translated)" lang="pt-BR" dir="ltr">português do Brasil</a></li> <li><a href="/wiki/Help:Extension:ParserFunctions/sk" class="mw-pt-progress mw-pt-progress--low" title="Help:Extension:ParserFunctions/sk (0% translated)" lang="sk" dir="ltr">slovenčina</a></li> <li><a href="/wiki/Help:Extension:ParserFunctions/sl" class="mw-pt-progress mw-pt-progress--low" title="Help:Extension:ParserFunctions/sl (0% translated)" lang="sl" dir="ltr">slovenščina</a></li> <li><a href="/wiki/Help:Extension:ParserFunctions/fi" class="mw-pt-progress mw-pt-progress--low" title="Ohje:Laajennus:ParserFunctions (11% translated)" lang="fi" dir="ltr">suomi</a></li> <li><a href="/wiki/Help:Extension:ParserFunctions/sv" class="mw-pt-progress mw-pt-progress--med" title="Help:Tillägg:ParserFunctions (29% translated)" lang="sv" dir="ltr">svenska</a></li> <li><a href="/wiki/Help:Extension:ParserFunctions/cs" class="mw-pt-progress mw-pt-progress--high" title="Nápověda:Rozšíření:ParserFunctions (94% translated)" lang="cs" dir="ltr">čeština</a></li> <li><a href="/wiki/Help:Extension:ParserFunctions/be-tarask" class="mw-pt-progress mw-pt-progress--low" title="Дапамога:Пашырэньне:Функцыі парсэру (6% translated)" lang="be-tarask" dir="ltr">беларуская (тарашкевіца)</a></li> <li><a href="/wiki/Help:Extension:ParserFunctions/bg" class="mw-pt-progress mw-pt-progress--low" title="Help:Extension:ParserFunctions/bg (0% translated)" lang="bg" dir="ltr">български</a></li> <li><a href="/wiki/Help:Extension:ParserFunctions/ru" class="mw-pt-progress mw-pt-progress--high" title="Справка:Расширение:Функции парсера (93% translated)" lang="ru" dir="ltr">русский</a></li> <li><a href="/wiki/Help:Extension:ParserFunctions/uk" class="mw-pt-progress mw-pt-progress--high" title="Довідка:Розширення:ParserFunctions (84% translated)" lang="uk" dir="ltr">українська</a></li> <li><a href="/wiki/Help:Extension:ParserFunctions/hy" class="mw-pt-progress mw-pt-progress--low" title="Օգնություն.Հավելում.ParserFunctions (4% translated)" lang="hy" dir="ltr">հայերեն</a></li> <li><a href="/wiki/Help:Extension:ParserFunctions/ar" class="mw-pt-progress mw-pt-progress--low" title="Help:Extension:ParserFunctions/ar (2% translated)" lang="ar" dir="rtl">العربية</a></li> <li><a href="/wiki/Help:Extension:ParserFunctions/fa" class="mw-pt-progress mw-pt-progress--med" title="Help:Extension:ParserFunctions (29% translated)" lang="fa" dir="rtl">فارسی</a></li> <li><a href="/wiki/Help:Extension:ParserFunctions/ps" class="mw-pt-progress mw-pt-progress--low" title="Help:Extension:ParserFunctions/ps (4% translated)" lang="ps" dir="rtl">پښتو</a></li> <li><a href="/wiki/Help:Extension:ParserFunctions/mr" class="mw-pt-progress mw-pt-progress--low" title="Help:Extension:ParserFunctions/mr (0% translated)" lang="mr" dir="ltr">मराठी</a></li> <li><a href="/wiki/Help:Extension:ParserFunctions/hi" class="mw-pt-progress mw-pt-progress--low" title="Help:Extension:ParserFunctions (4% translated)" lang="hi" dir="ltr">हिन्दी</a></li> <li><a href="/wiki/Help:Extension:ParserFunctions/bn" class="mw-pt-progress mw-pt-progress--low" title="Help:Extension:ParserFunctions/bn (2% translated)" lang="bn" dir="ltr">বাংলা</a></li> <li><a href="/wiki/Help:Extension:ParserFunctions/gu" class="mw-pt-progress mw-pt-progress--low" title="Help:Extension:ParserFunctions/gu (1% translated)" lang="gu" dir="ltr">ગુજરાતી</a></li> <li><a href="/wiki/Help:Extension:ParserFunctions/ta" class="mw-pt-progress mw-pt-progress--low" title="Help:Extension:ParserFunctions/ta (5% translated)" lang="ta" dir="ltr">தமிழ்</a></li> <li><a href="/wiki/Help:Extension:ParserFunctions/th" class="mw-pt-progress mw-pt-progress--med" title="วิธีใช้:ส่วนขยาย:ParserFunctions (21% translated)" lang="th" dir="ltr">ไทย</a></li> <li><a href="/wiki/Help:Extension:ParserFunctions/zh" class="mw-pt-progress mw-pt-progress--high" title="Help:Extension:解析器函數 (93% translated)" lang="zh" dir="ltr">中文</a></li> <li><a href="/wiki/Help:Extension:ParserFunctions/ja" class="mw-pt-progress mw-pt-progress--high" title="Help:Extension:ParserFunctions (95% translated)" lang="ja" dir="ltr">日本語</a></li> <li><a href="/wiki/Help:Extension:ParserFunctions/ko" class="mw-pt-progress mw-pt-progress--low" title="도움말:확장기능:파서 함수 (13% translated)" lang="ko" dir="ltr">한국어</a></li></ul></div> <p>The <a href="/wiki/Special:MyLanguage/Extension:ParserFunctions" title="Special:MyLanguage/Extension:ParserFunctions">ParserFunctions</a><span style="display:none"><a href="/wiki/Extension:ParserFunctions" title="Extension:ParserFunctions"> </a></span> extension provides additional <a href="/wiki/Special:MyLanguage/Parser_functions" title="Special:MyLanguage/Parser functions">parser functions</a> to supplement the "<a href="/wiki/Special:MyLanguage/Help:Magic_words#Parser_functions" title="Special:MyLanguage/Help:Magic words">magic words</a><span style="display:none"><a href="/wiki/Help:Magic_words#Parser_functions" title="Help:Magic words"> </a></span>", which are already present in MediaWiki. (It <i>may</i> be configured to provide additional parser functions for string handling; these string functions are documented <a href="/wiki/Special:MyLanguage/Extension:ParserFunctions/String_functions" title="Special:MyLanguage/Extension:ParserFunctions/String functions">elsewhere</a><span style="display:none"><a href="/wiki/Extension:ParserFunctions/String_functions" title="Extension:ParserFunctions/String functions"> </a></span>.) All the parser functions provided by this extension take the form: </p> <dl><dd><code>{{<b>#functionname</b>: <i>argument 1</i> | <i>argument 2</i> | <i>argument 3</i> ... }}</code></dd></dl> <style data-mw-deduplicate="TemplateStyles:r6776268">.mw-parser-output .template-pd-help-page{color:var(--color-emphasized,#101418);border:solid 1px var(--border-color-base,#a2a9b1);padding:0.5em;margin:0.5em 0;background-color:var(--background-color-base,#ffffff);font-size:95%;vertical-align:middle;width:100%;box-sizing:border-box}.mw-parser-output .template-pd-help-page .icon-cell{padding:0 1em;width:30px}</style><table class="template-pd-help-page"><tbody><tr> <td class="icon-cell"><span typeof="mw:File"><span><img alt="PD" src="//upload.wikimedia.org/wikipedia/commons/thumb/6/62/PD-icon.svg/30px-PD-icon.svg.png" decoding="async" width="30" height="30" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/6/62/PD-icon.svg/45px-PD-icon.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/6/62/PD-icon.svg/60px-PD-icon.svg.png 2x" data-file-width="196" data-file-height="196"/></span></span></td> <td><b>Note:</b> When you edit this page, you agree to release your contribution under the <a rel="nofollow" class="external text" href="https://creativecommons.org/publicdomain/zero/1.0/">CC0</a>. See <a href="/wiki/Special:MyLanguage/Project:PD_help" title="Special:MyLanguage/Project:PD help">Public Domain Help Pages</a> for more info. </td> <td class="icon-cell"><span typeof="mw:File"><span><img alt="PD" src="//upload.wikimedia.org/wikipedia/commons/thumb/6/62/PD-icon.svg/30px-PD-icon.svg.png" decoding="async" width="30" height="30" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/6/62/PD-icon.svg/45px-PD-icon.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/6/62/PD-icon.svg/60px-PD-icon.svg.png 2x" data-file-width="196" data-file-height="196"/></span></span></td> </tr></tbody></table> <meta property="mw:PageProp/toc"/> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="#expr" data-mw-thread-id="h-#expr"><span id=".23expr"></span><span data-mw-comment-start="" id="h-#expr"></span>#expr<span data-mw-comment-end="h-#expr"></span></h2><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-#expr","replies":["h-Rounding-#expr","h-Strings-#expr"]}}--></div> <style data-mw-deduplicate="TemplateStyles:r6353907">.mw-parser-output .hatnote{font-style:italic;padding-bottom:0.4em;margin-bottom:0.4em;border-bottom:1px solid #ccc}.mw-parser-output .hatnote.no-border{border-bottom:none}</style><div role="note" class="hatnote">For a more in-depth manual on the finer points of how the expression evaluator works, including some additional operators not covered here, see: <a href="/wiki/Manual:Expr_parser_function_syntax" title="Manual:Expr parser function syntax">Manual:Expr parser function syntax</a>.</div> <table class="wikitable" style="float:right; width:30%; margin-left:1em"> <tbody><tr> <th style="background:#C5D8FC">Type </th> <th style="background:#C5D8FC">Operators </th></tr> <tr> <td style="background:#A7C1F2">Grouping (parentheses) </td> <td style="word-spacing: 0.5em; font-weight: bold;"><code>( )</code> </td></tr> <tr> <td style="background:#A7C1F2">Numbers </td> <td><code><b>1234.5</b></code> <code><b>e</b></code> (2.718) <code><b>pi</b></code> (3.142) </td></tr> <tr> <td style="background:#A7C1F2"> </td> <td>binary operator <code><b>e</b></code> unary <code><b>+</b></code>,<code><b>-</b></code> </td></tr> <tr> <td style="background:#A7C1F2">Unary </td> <td style="word-spacing: 0.5em; font-weight: bold;"><code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> </td></tr> <tr> <td style="background:#A7C1F2" rowspan="3">Binary </td> <td style="word-spacing: 0.5em; font-weight: bold;"><code>^</code> </td></tr> <tr> <td style="word-spacing: 0.5em; font-weight: bold;"><code>* / div mod fmod</code> </td></tr> <tr> <td style="word-spacing: 0.5em; font-weight: bold;"><code>+ -</code> </td></tr> <tr> <td style="background:#A7C1F2">Round </td> <td style="word-spacing: 0.5em; font-weight: bold;"><code>round</code> </td></tr> <tr> <td style="background:#A7C1F2" rowspan="3">Logic </td> <td style="word-spacing: 0.5em; font-weight: bold;"><code>= != <> > < >= <=</code> </td></tr> <tr> <td style="word-spacing: 0.5em; font-weight: bold;"><code>and</code> </td></tr> <tr> <td style="word-spacing: 0.5em; font-weight: bold;"><code>or</code> </td></tr></tbody></table> <p>This function evaluates a mathematical expression and returns the calculated value. This function is also available in <a href="/wiki/Special:MyLanguage/Extension:Scribunto" title="Special:MyLanguage/Extension:Scribunto">Scribunto</a><span style="display:none"><a href="/wiki/Extension:Scribunto" title="Extension:Scribunto"> </a></span> via the <code>mw.ext.ParserFunctions.expr</code> function. </p> <dl><dd><code>{{#expr: <i>expression</i> }}</code></dd></dl> <p>Basic example </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#expr</span><span class="p">:</span> 1 + 1 <span class="p">}}</span></code> → <b>2</b></dd></dl> <p>The available operators are listed to the right, in order of precedence. See <a href="/wiki/Special:MyLanguage/Manual:Expr_parser_function_syntax" title="Special:MyLanguage/Manual:Expr parser function syntax">Manual:Expr parser function syntax</a><span style="display:none"><a href="/wiki/Manual:Expr_parser_function_syntax" title="Manual:Expr parser function syntax"> </a></span> for more details of the function of each operator. The accuracy and format of the result returned will vary depending on the operating system of the server running the wiki and the number format of the site language. </p><p>When evaluating using <a href="https://en.wikipedia.org/wiki/boolean_algebra" class="extiw" title="w:boolean algebra">boolean algebra</a>, zero evaluates to <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="k">false</span></code>, and any nonzero value, positive or negative, evaluates to <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="k">true</span></code>: </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#expr</span><span class="p">:</span> 1 and -1 <span class="p">}}</span></code> → <b>1</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#expr</span><span class="p">:</span> 1 and 0 <span class="p">}}</span></code> → <b>0</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#expr</span><span class="p">:</span> 1 or -1 <span class="p">}}</span></code> → <b>1</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#expr</span><span class="p">:</span> -1 or 0 <span class="p">}}</span></code> → <b>1</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#expr</span><span class="p">:</span> 0 or 0 <span class="p">}}</span></code> → <b>0</b></dd></dl> <p>An empty input expression returns an empty string. Invalid expressions return one of several error messages, which can be caught using the <code><a href="##iferror">#iferror</a></code> function: </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#expr</span><span class="p">:</span> <span class="p">}}</span></code> → <b> </b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#expr</span><span class="p">:</span> 1+ <span class="p">}}</span></code> → <b><strong class="error">Expression error: Missing operand for +.</strong></b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#expr</span><span class="p">:</span> 1 = <span class="p">}}</span></code> → <b><strong class="error">Expression error: Missing operand for =.</strong></b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#expr</span><span class="p">:</span> 1 foo 2 <span class="p">}}</span></code> → <b><strong class="error">Expression error: Unrecognized word "foo".</strong></b></dd></dl> <p>The order of addition and subtraction operands before or after a number is meaningful and may be treated as a positive or negative value instead of as an operand with an erroneous input: </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#expr</span><span class="p">:</span> +1 <span class="p">}}</span></code> → <b>1</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#expr</span><span class="p">:</span> -1 <span class="p">}}</span></code> → <b>-1</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#expr</span><span class="p">:</span> + 1 <span class="p">}}</span></code> → <b>1</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#expr</span><span class="p">:</span> - 1 <span class="p">}}</span></code> → <b>-1</b></dd></dl> <p>Note, if using the output of magic words, you must raw-format them in order to remove commas and translate the numerals. For example, {{NUMBEROFUSERS}} results in 18,026,642, where we want 18026642, which can be obtained using <code>{{<a href="/wiki/Special:MyLanguage/Help:Magic_words#Formatting" title="Special:MyLanguage/Help:Magic words">formatnum</a><span style="display:none"><a href="/wiki/Help:Magic_words#Formatting" title="Help:Magic words"> </a></span>:{{NUMBEROFUSERS}}|R}}</code>. This is especially important in some languages, where numerals are translated. For example, in Bengali, {{NUMBEROFUSERS}} produces ৩০,০৬১. </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#expr</span><span class="p">:{{</span><span class="nf">NUMBEROFUSERS</span><span class="p">}}</span>+100<span class="p">}}</span></code> → <b> <strong class="error">Expression error: Unrecognized punctuation character ",".</strong></b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#expr</span><span class="p">:{{</span><span class="nf">formatnum</span><span class="p">:{{</span><span class="nf">NUMBEROFUSERS</span><span class="p">}}|</span>R<span class="p">}}</span>+100<span class="p">}}</span></code> → <b>18026742</b></dd></dl> <table class="warning-message" style="background-color: var( --background-color-error-subtle, #ffe9e5 ); color: var( --color-base, #202122 ); border: 1px var( --border-color-error, #9f3526 ) solid; box-sizing: border-box; margin: 0.5em 0; padding: 0.5em;"><tbody><tr><td style="white-space: nowrap; vertical-align: top;"><span style="position: relative; top: -2px;"><span typeof="mw:File"><span><img alt="Warning" src="//upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/18px-OOjs_UI_icon_notice-destructive.svg.png" decoding="async" width="18" height="18" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/27px-OOjs_UI_icon_notice-destructive.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/36px-OOjs_UI_icon_notice-destructive.svg.png 2x" data-file-width="20" data-file-height="20"/></span></span></span> <b>Warning:</b> </td><td style="padding-left: 0.5em vertical-align: top;">The operator <code>mod</code> gives wrong results for some values of the second argument: <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#expr</span><span class="p">:</span> 123 mod (2^64-1)<span class="p">}}</span></code> → <strong class="error">Division by zero.</strong> (produces an empty string; should be 123)<br/></dd></dl></td></tr></tbody></table> <style data-mw-deduplicate="TemplateStyles:r6651107">.mw-parser-output .note{background-position:left 7px top 50%;padding:0.5em 0.5em 0.5em 40px;margin:0.5em 0;overflow:hidden;background-color:#f8f9fa;color:#333;background-repeat:no-repeat;border:1px solid #ddd}.mw-parser-output .note-inline{display:inline-block;vertical-align:middle}.mw-parser-output .note-info{background-color:#eaf3ff;color:#333;background-image:url("https://upload.wikimedia.org/wikipedia/commons/e/ec/OOjs_UI_icon_information-progressive.svg");background-size:25px;border-color:#a3caff;padding-left:40px;min-height:25px}.mw-parser-output .note-reminder{background-color:#fff9ea;color:#333;background-image:url("https://upload.wikimedia.org/wikipedia/commons/a/a8/OOjs_UI_icon_lightbulb-yellow.svg");background-size:25px;border-color:#fc3;min-height:25px}.mw-parser-output .note-warn{background-color:#fff9ea;color:#333;background-image:url("https://upload.wikimedia.org/wikipedia/commons/3/3b/OOjs_UI_icon_alert-warning.svg");background-size:25px;border-color:#fc3;min-height:25px}.mw-parser-output .note-error{background-color:#fee7e6;color:#333;background-image:url("https://upload.wikimedia.org/wikipedia/commons/b/bf/OOjs_UI_icon_notice-destructive.svg");background-size:25px;border-color:#c33;min-height:25px}@media screen{html.skin-theme-clientpref-night .mw-parser-output .note{background-color:transparent;color:inherit}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .note{background-color:transparent;color:inherit}}</style><div role="note" class="note note-reminder">If you want to do calculations based on dates (ex. test whether current date and time is after some other date and time), first convert the time to number of seconds after January 1, 1970 (UTC) using {{#time: xNU }}, then you can simply add and subtract dates as numbers.</div> <div class="mw-heading mw-heading3"><h3 id="Rounding" data-mw-thread-id="h-Rounding-#expr"><span data-mw-comment-start="" id="h-Rounding-#expr"></span>Rounding<span data-mw-comment-end="h-Rounding-#expr"></span></h3></div> <p><a rel="nofollow" class="external text" href="https://php.net/function.round">Rounds</a> off the number on the left to a multiple of 1/10 raised to a power, with the exponent equal to the truncated value of the number given on the right. </p><p>To round up or down use unary <code>ceil</code> or <code>floor</code> respectively. </p> <table class="wikitable"> <tbody><tr> <th style="background:#C5D8FC">Test case </th> <th style="background:#C5D8FC">Result </th> <th style="background:#C5D8FC">Method of rounding </th></tr> <tr> <td><code style="white-space:nowrap;">{{#expr: 1/3 round 5 }}</code></td> <td>0.33333</td> <td>Final digit is < 5, so no apparent rounding occurs (0.333333… → 0.33333) </td></tr> <tr> <td><code style="white-space:nowrap;">{{#expr: 1/6 round 5 }}</code></td> <td>0.16667</td> <td>Final digit is ≥ 5, so it is rounded up (0.166666… → 0.16667) </td></tr> <tr> <td><code style="white-space:nowrap;">{{#expr: 8.99999/9 round 5 }}</code></td> <td>1</td> <td>Again, the result is rounded up on the last digit, which results in additional rounding (0.999998… → 1.00000 → 1) </td></tr> <tr> <td><code style="white-space:nowrap;">{{#expr: 1234.5678 <b>round -2</b> }}</code></td> <td>1200</td> <td>Rounded to nearest 100 because negative values round to the left of the decimal point </td></tr> <tr> <td><code style="white-space:nowrap;">{{#expr: 1234.5678 <b>round 2</b> }}</code></td> <td>1234.57</td> <td>Rounded to nearest 100th because positive values round to the right of the decimal point </td></tr> <tr> <td><code style="white-space:nowrap;">{{#expr: 1234.5678 round 2<b>.3</b> }}</code></td> <td>1234.57</td> <td>Decimals in the rounding index make no difference in the rounded result </td></tr> <tr> <td><code style="white-space:nowrap;">{{#expr: <b>trunc</b> 1234.5678 }}</code></td> <td>1234</td> <td>Decimal portion truncated (chopped off) </td></tr> <tr> <th colspan="3" style="background:#A7C1F2">Rounding to the nearest integer </th></tr> <tr> <td><code style="white-space:nowrap;">{{#expr: 1/3 <b>round 0</b> }}</code></td> <td>0</td> <td>Down to the <i>nearest</i> integer, which is zero </td></tr> <tr> <td><code style="white-space:nowrap;">{{#expr: 1/2 <b>round 0</b> }}</code></td> <td>1</td> <td>Up to the nearest integer, which is one </td></tr> <tr> <td><code style="white-space:nowrap;">{{#expr: 3/4 <b>round 0</b> }}</code></td> <td>1</td> <td>Up to the nearest integer, which is one </td></tr> <tr> <td><code style="white-space:nowrap;">{{#expr: -1/3 <b>round 0</b> }}</code></td> <td>-0</td> <td>Up to the nearest integer, which is zero </td></tr> <tr> <td><code style="white-space:nowrap;">{{#expr: -1/2 <b>round 0</b> }}</code></td> <td>-1</td> <td>Down to the nearest integer, which is negative one </td></tr> <tr> <td><code style="white-space:nowrap;">{{#expr: -3/4 <b>round 0</b> }}</code></td> <td>-1</td> <td>Down to the nearest integer, which is negative one </td></tr> <tr> <th colspan="3" style="background:#A7C1F2">Rounding up or down with <i>ceil</i> and <i>floor</i> </th></tr> <tr> <td><code style="white-space:nowrap;">{{#expr: <b>ceil(</b>1/3<b>)</b> }}</code></td> <td>1</td> <td>Up to the next <i>larger</i> integer, which is one </td></tr> <tr> <td><code style="white-space:nowrap;">{{#expr: <b>floor(</b>1/3<b>)</b> }}</code></td> <td>0</td> <td>Down to the next <i>smaller</i> integer, which is zero </td></tr> <tr> <td><code style="white-space:nowrap;">{{#expr: <b>ceil(</b>-1/3<b>)</b> }}</code></td> <td>-0</td> <td>Up to the next larger integer, which is zero </td></tr> <tr> <td><code style="white-space:nowrap;">{{#expr: <b>floor(</b>-1/3<b>)</b> }}</code></td> <td>-1</td> <td>Down to the next smaller integer, which is negative one </td></tr> <tr> <td><code style="white-space:nowrap;">{{#expr: <b>ceil</b> 1/3 }}</code></td> <td>0.33333333333333</td> <td>Not rounded, since 1 already is an integer<br/><table class="warning-message" style="background-color: var( --background-color-error-subtle, #ffe9e5 ); color: var( --color-base, #202122 ); border: 1px var( --border-color-error, #9f3526 ) solid; box-sizing: border-box; margin: 0.5em 0; padding: 0.5em;"><tbody><tr><td style="white-space: nowrap; vertical-align: top;"><span style="position: relative; top: -2px;"><span typeof="mw:File"><span><img alt="Warning" src="//upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/18px-OOjs_UI_icon_notice-destructive.svg.png" decoding="async" width="18" height="18" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/27px-OOjs_UI_icon_notice-destructive.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/36px-OOjs_UI_icon_notice-destructive.svg.png 2x" data-file-width="20" data-file-height="20"/></span></span></span> <b>Warning:</b> </td><td style="padding-left: 0.5em vertical-align: top;">Interpreted as <b>(ceil</b> 1<b>)</b>/3, not <b>ceil(</b>1/3<b>)</b>, as you might expect</td></tr></tbody></table> </td></tr> <tr> <th colspan="3" style="background:#A7C1F2">Rounding large numbers </th></tr> <tr> <td><code style="white-space:nowrap;">{{#expr: 1e-92 round 400 }}</code></td> <td>1.0E-92 </td> <td>Rounding to a very large number leads to infinity. Hence, the original value without the infinity is given as the answer. </td></tr> <tr> <td><code style="white-space:nowrap;">{{#expr: 1e108 round 200 }}</code></td> <td>1.0E+108 </td> <td>Same as above. </td></tr></tbody></table> <div class="mw-heading mw-heading3"><h3 id="Strings" data-mw-thread-id="h-Strings-#expr"><span data-mw-comment-start="" id="h-Strings-#expr"></span>Strings<span data-mw-comment-end="h-Strings-#expr"></span></h3></div> <p>Expressions only work with number-like values, they cannot compare strings or characters. <a href="#ifeq">#ifeq</a> can be used instead. </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#expr</span><span class="p">:</span> "a" = "a" <span class="p">}}</span></code> → <b><strong class="error">Expression error: Unrecognized punctuation character """.</strong></b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#expr</span><span class="p">:</span> a = a <span class="p">}}</span></code> → <b><strong class="error">Expression error: Unrecognized word "a".</strong></b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#ifeq</span><span class="p">:</span> a <span class="p">|</span> a <span class="p">|</span> 1 <span class="p">|</span> 0 <span class="p">}}</span></code> → <b>1</b></dd></dl> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="#if" data-mw-thread-id="h-#if"><span id=".23if"></span><span data-mw-comment-start="" id="h-#if"></span>#if<span data-mw-comment-end="h-#if"></span></h2><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-#if","replies":[]}}--></div> <p>This function evaluates a test string and determines whether or not it is empty. A test string containing only white space is considered to be empty. </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#if</span><span class="p">:</span> test string <span class="p">|</span> value if test string is not empty <span class="p">|</span> value if test string is empty (or only white space)<span class="p">}}</span></code></dd></dl> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#if</span><span class="p">:</span> first parameter <span class="p">|</span> second parameter <span class="p">|</span> third parameter <span class="p">}}</span></code></dd></dl> <p>This function first tests whether the first parameter is not empty. If the first parameter is not empty, the function displays the second argument. If the first parameter is empty or contains only whitespace characters (spaces, newlines, etc.) it displays the third argument. </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#if</span><span class="p">:</span> <span class="p">|</span> yes <span class="p">|</span> no<span class="p">}}</span></code> → <b>no</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#if</span><span class="p">:</span> string <span class="p">|</span> yes <span class="p">|</span> no<span class="p">}}</span></code> → <b>yes</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#if</span><span class="p">:</span> <span class="ni">&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class="p">|</span> yes <span class="p">|</span> no<span class="p">}}</span></code> → <b>no</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#if</span><span class="p">:</span> <span class="p">|</span> yes <span class="p">|</span> no<span class="p">}}</span></code> → <b>no</b></dd></dl> <p>The test string is always interpreted as pure text, so mathematical expressions are not evaluated (see <a href="##ifexpr">#ifexpr</a> for that): </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#if</span><span class="p">:</span> 1==2 <span class="p">|</span> yes <span class="p">|</span> no <span class="p">}}</span></code> → <b>yes</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#if</span><span class="p">:</span> 0 <span class="p">|</span> yes <span class="p">|</span> no <span class="p">}}</span></code> → <b>yes</b></dd></dl> <p>The last parameter (false) may be omitted: </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#if</span><span class="p">:</span> foo <span class="p">|</span> yes <span class="p">}}</span></code> → <b> yes</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#if</span><span class="p">:</span> <span class="p">|</span> yes <span class="p">}}</span></code> → <b> </b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#if</span><span class="p">:</span> foo <span class="p">|</span> <span class="p">|</span> no<span class="p">}}</span></code> → <b> </b></dd></dl> <p>The function may be nested. To do so, nest the inner <code>#if</code> function in its full form in place of a parameter of the enclosing <code>#if</code> function. Up to seven levels of nesting is possible, although that may depend on the wiki or a memory limit. </p> <div class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><pre><span></span><span class="p">{{</span><span class="nf">#if</span><span class="p">:</span>test string <span class="p">|</span>value if test string is not empty <span class="p">|{{</span><span class="nf">#if</span><span class="p">:</span>test string <span class="p">|</span>value if test string is not empty <span class="p">|</span>value if test string is empty (or only white space) <span class="p">}}</span> <span class="p">}}</span> </pre></div> <p>You can also use a parameter as the test string in your <code>#if</code> statement. You need to ensure you add the <code>|</code> (pipe symbol) after the name of the variable. (So that if the parameter does not have a value, it evaluates to an empty string instead of the string "<code>{{{1}}}</code>".) </p> <dl><dd><code class="mw-highlight">{{#if:<span class="nb">{{{</span><span class="cp">1</span><span style="color:#d73333" dir="ltr">|</span><span class="nb">}}}</span>|You entered text in variable 1|There is no text in variable 1}}</code></dd></dl> <p>See <a href="/wiki/Special:MyLanguage/Help:Parser_functions_in_templates" title="Special:MyLanguage/Help:Parser functions in templates">Help:Parser functions in templates</a><span style="display:none"><a href="/wiki/Help:Parser_functions_in_templates" title="Help:Parser functions in templates"> </a></span> for more examples of this parser function. </p><p><span class="anchor" id="ifeq"></span><span class="anchor" id="IFEQ"></span><span class="anchor" id="Ifeq"></span><span class="anchor" id="IfEq"></span><span class="anchor" id="If_equal"></span> </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="#ifeq" data-mw-thread-id="h-#ifeq"><span id=".23ifeq"></span><span data-mw-comment-start="" id="h-#ifeq"></span>#ifeq<span data-mw-comment-end="h-#ifeq"></span></h2><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-#ifeq","replies":[]}}--></div> <p>This parser function compares two input strings, determines whether they are identical, and returns one of two strings based on the result. If more comparisons and output strings are required, consider using <code>#switch</code>. </p> <dl><dd><code>{{#ifeq: <i>string 1</i> | <i>string 2</i> | <i>value if identical</i> | <i>value if different</i> }}</code></dd></dl> <p>If both strings are valid numerical values, the strings are compared numerically: </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#ifeq</span><span class="p">:</span> 01 <span class="p">|</span> 1 <span class="p">|</span> equal <span class="p">|</span> not equal<span class="p">}}</span></code> → <b>equal</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#ifeq</span><span class="p">:</span> 0 <span class="p">|</span> -0 <span class="p">|</span> equal <span class="p">|</span> not equal<span class="p">}}</span></code> → <b>equal</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#ifeq</span><span class="p">:</span> 1e3 <span class="p">|</span> 1000 <span class="p">|</span> equal <span class="p">|</span> not equal<span class="p">}}</span></code> → <b>equal</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#ifeq</span><span class="p">:</span> <span class="p">{{</span><span class="nf">#expr</span><span class="p">:</span>10^3<span class="p">}}</span> <span class="p">|</span> 1000 <span class="p">|</span> equal <span class="p">|</span> not equal<span class="p">}}</span></code> → <b>equal</b></dd></dl> <p>Otherwise, the comparison is made as text; this comparison is case-sensitive: </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#ifeq</span><span class="p">:</span> foo <span class="p">|</span> bar <span class="p">|</span> equal <span class="p">|</span> not equal<span class="p">}}</span></code> → <b>not equal</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#ifeq</span><span class="p">:</span> foo <span class="p">|</span> Foo <span class="p">|</span> equal <span class="p">|</span> not equal<span class="p">}}</span></code> → <b>not equal</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#ifeq</span><span class="p">:</span> "01" <span class="p">|</span> "1" <span class="p">|</span> equal <span class="p">|</span> not equal<span class="p">}}</span></code> → <b>not equal</b> <i>(compare to similar example above, without the quotes)</i></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#ifeq</span><span class="p">:</span> 10^3 <span class="p">|</span> 1000 <span class="p">|</span> equal <span class="p">|</span> not equal<span class="p">}}</span></code> → <b>not equal</b> <i>(compare to similar example above, with <code><a href="##expr">#expr</a></code> returning a valid number first)</i></dd></dl> <p>As a practical example, consider an existing <a href="/wiki/Special:MyLanguage/Help:Templates" title="Special:MyLanguage/Help:Templates">template</a><span style="display:none"><a href="/wiki/Help:Templates" title="Help:Templates"> </a></span> <code>Template:Timer</code> using the parser to choose between two standard times, short and long. It takes the parameter as the first input to compare against the string "short" – there is no convention for the order, but it is simpler to read if the parameter goes first. The template code is defined as: </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#ifeq</span><span class="p">:</span> <span class="p">{{{</span><span class="nv">1</span><span class="p">|}}}</span> <span class="p">|</span> short <span class="p">|</span> 20 <span class="p">|</span> 40 <span class="p">}}</span></code></dd></dl> <p>the following ensue: </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nt">timer</span><span class="p">|</span>short<span class="p">}}</span></code> → <b>20</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nt">timer</span><span class="p">|</span>20<span class="p">}}</span></code> → <b>40</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nt">timer</span><span class="p">}}</span></code> → <b>40</b></dd></dl> <table class="warning-message" style="background-color: var( --background-color-error-subtle, #ffe9e5 ); color: var( --color-base, #202122 ); border: 1px var( --border-color-error, #9f3526 ) solid; box-sizing: border-box; margin: 0.5em 0; padding: 0.5em;"><tbody><tr><td style="white-space: nowrap; vertical-align: top;"><span style="position: relative; top: -2px;"><span typeof="mw:File"><span><img alt="Warning" src="//upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/18px-OOjs_UI_icon_notice-destructive.svg.png" decoding="async" width="18" height="18" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/27px-OOjs_UI_icon_notice-destructive.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/36px-OOjs_UI_icon_notice-destructive.svg.png 2x" data-file-width="20" data-file-height="20"/></span></span></span> <b>Warning:</b> </td><td style="padding-left: 0.5em vertical-align: top;">When used inside a parser function, any parser tags and other parser functions must be temporarily replaced with <a href="/wiki/Special:MyLanguage/Strip_marker" title="Special:MyLanguage/Strip marker">a unique code</a><span style="display:none"><a href="/wiki/Strip_marker" title="Strip marker"> </a></span>. This affects comparisons: <dl><dd><code>{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}}</code> → <b>not equal </b></dd> <dd><code>{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}}</code> → <b>not equal </b></dd> <dd><code>{{#ifeq: {{<a href="/wiki/Help:Magic_words#Miscellaneous" title="Help:Magic words">#tag:</a>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</code> → <b>not equal </b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#ifeq</span><span class="p">:</span> <span class="p">[[</span><span class="nt">foo</span><span class="p">]]</span> <span class="p">|</span> <span class="p">[[</span><span class="nt">foo</span><span class="p">]]</span> <span class="p">|</span> equal <span class="p">|</span> not equal<span class="p">}}</span></code> → <b>equal </b></dd></dl> If the strings to be compared are given as equal calls to the same <a href="/wiki/Special:MyLanguage/Help:Templates" title="Special:MyLanguage/Help:Templates">template</a><span style="display:none"><a href="/wiki/Help:Templates" title="Help:Templates"> </a></span> containing such tags, then the condition is true, but in the case of two templates with identical content containing such tags it is false.</td></tr></tbody></table> <table class="warning-message" style="background-color: var( --background-color-error-subtle, #ffe9e5 ); color: var( --color-base, #202122 ); border: 1px var( --border-color-error, #9f3526 ) solid; box-sizing: border-box; margin: 0.5em 0; padding: 0.5em;"><tbody><tr><td style="white-space: nowrap; vertical-align: top;"><span style="position: relative; top: -2px;"><span typeof="mw:File"><span><img alt="Warning" src="//upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/18px-OOjs_UI_icon_notice-destructive.svg.png" decoding="async" width="18" height="18" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/27px-OOjs_UI_icon_notice-destructive.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/36px-OOjs_UI_icon_notice-destructive.svg.png 2x" data-file-width="20" data-file-height="20"/></span></span></span> <b>Warning:</b> </td><td style="padding-left: 0.5em vertical-align: top;">Literal comparisons to <a href="/wiki/Special:MyLanguage/Help:Magic_words#Page_names" title="Special:MyLanguage/Help:Magic words">page-name magic words</a><span style="display:none"><a href="/wiki/Help:Magic_words#Page_names" title="Help:Magic words"> </a></span> may fail depending on site configuration. For example, {{FULLPAGENAME}}, depending on wiki, may capitalize the first letter, and will replace all underscores with spaces. <p>To work around this, apply the magic word to both parameters: </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#ifeq</span><span class="p">:</span> <span class="p">{{</span><span class="nf">FULLPAGENAME</span><span class="p">:</span> L'Aquila<span class="p">}}</span> <span class="p">|</span> <span class="p">{{</span><span class="nf">FULLPAGENAME</span><span class="p">}}</span> <span class="p">|</span> equal <span class="p">|</span> not equal<span class="p">}}</span></code> → <b>equal</b></dd></dl></td></tr></tbody></table> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="#iferror" data-mw-thread-id="h-#iferror"><span id=".23iferror"></span><span data-mw-comment-start="" id="h-#iferror"></span>#iferror<span data-mw-comment-end="h-#iferror"></span></h2><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-#iferror","replies":[]}}--></div> <p>This function takes an input string and returns one of two results; the function evaluates to <code>true</code> if the input string contains an HTML object with <code>class="error"</code>, as generated by other parser functions such as <code><a href="##expr">#expr</a></code>, <code><a href="##time">#time</a></code> and <code><a href="##rel2abs">#rel2abs</a></code>, <a href="/wiki/Special:MyLanguage/Help:Templates" title="Special:MyLanguage/Help:Templates">template</a> errors such as loops and recursions, and other "failsoft" parser errors. </p> <dl><dd><code>{{#iferror: <i>test string</i> | <i>value if error</i> | <i>value if correct</i> }}</code></dd></dl> <p>One or both of the return strings can be omitted. If the <code>correct</code> string is omitted, the <code>test string</code> is returned if it is not erroneous. If the <code>error</code> string is also omitted, an empty string is returned on an error: </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#iferror</span><span class="p">:</span> <span class="p">{{</span><span class="nf">#expr</span><span class="p">:</span> 1 + 2 <span class="p">}}</span> <span class="p">|</span> error <span class="p">|</span> correct <span class="p">}}</span></code> → <b>correct</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#iferror</span><span class="p">:</span> <span class="p">{{</span><span class="nf">#expr</span><span class="p">:</span> 1 + X <span class="p">}}</span> <span class="p">|</span> error <span class="p">|</span> correct <span class="p">}}</span></code> → <b>error</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#iferror</span><span class="p">:</span> <span class="p">{{</span><span class="nf">#expr</span><span class="p">:</span> 1 + 2 <span class="p">}}</span> <span class="p">|</span> error <span class="p">}}</span></code> → <b>3</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#iferror</span><span class="p">:</span> <span class="p">{{</span><span class="nf">#expr</span><span class="p">:</span> 1 + X <span class="p">}}</span> <span class="p">|</span> error <span class="p">}}</span></code> → <b>error</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#iferror</span><span class="p">:</span> <span class="p">{{</span><span class="nf">#expr</span><span class="p">:</span> 1 + 2 <span class="p">}}</span> <span class="p">}}</span></code> → <b>3</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#iferror</span><span class="p">:</span> <span class="p">{{</span><span class="nf">#expr</span><span class="p">:</span> 1 + X <span class="p">}}</span> <span class="p">}}</span></code> → <b></b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#iferror</span><span class="p">:</span> <span class="p">{{</span><span class="nf">#expr</span><span class="p">:</span> . <span class="p">}}</span> <span class="p">|</span> error <span class="p">|</span> correct <span class="p">}}</span></code> → <b>correct</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#iferror</span><span class="p">:</span> <span class="p"><</span><span class="nt">strong</span><span class="w"> </span><span class="na">class</span><span class="o">=</span><span class="s2">"error"</span><span class="p">></span>a<span class="p"></</span><span class="nt">strong</span><span class="p">></span> <span class="p">|</span> error <span class="p">|</span> correct <span class="p">}}</span></code> → <b>error</b></dd></dl> <p>Some errors may cause a tracking category to be added, using <code>{{#iferror:}}</code> will not suppress the addition of the category. </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="#ifexpr" data-mw-thread-id="h-#ifexpr"><span id=".23ifexpr"></span><span data-mw-comment-start="" id="h-#ifexpr"></span>#ifexpr<span data-mw-comment-end="h-#ifexpr"></span></h2><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-#ifexpr","replies":[]}}--></div> <p>This function evaluates a mathematical expression and returns one of two strings depending on the boolean value of the result: </p> <dl><dd><code>{{#ifexpr: <i>expression</i> | <i>value if true</i> | <i>value if false</i> }}</code></dd></dl> <p>The <code>expression</code> input is evaluated exactly as for <code><a href="##expr">#expr</a></code> above, with the same operators being available. The output is then evaluated as a boolean expression. </p><p>An empty input expression evaluates to <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="k">false</span></code>: </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#ifexpr</span><span class="p">:</span> <span class="p">|</span> yes <span class="p">|</span> no<span class="p">}}</span></code> → <b>no</b></dd></dl> <p>As mentioned above, zero evaluates to <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="k">false</span></code> and any nonzero value evaluates to <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="k">true</span></code>, so this function is equivalent to one using <code><a href="##ifeq">#ifeq</a></code> and <code><a href="##expr">#expr</a></code> only: </p> <dl><dd><code>{{#ifeq: {{#expr: <i>expression</i> }} | 0 | <i>value if false</i> | <i>value if true</i> }}</code></dd></dl> <p>except for an empty or wrong input expression (an error message is treated as an empty string; it is not equal to zero, so we get <code>value if true</code>). </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#ifexpr</span><span class="p">:</span> = <span class="p">|</span> yes <span class="p">|</span> no <span class="p">}}</span></code> → <b> <strong class="error">Expression error: Unexpected = operator.</strong></b></dd></dl> <p>comparing </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#ifeq</span><span class="p">:</span> <span class="p">{{</span><span class="nf">#expr</span><span class="p">:</span> = <span class="p">}}</span> <span class="p">|</span> 0 <span class="p">|</span> no <span class="p">|</span> yes <span class="p">}}</span></code> → <b> yes</b></dd></dl> <p>Either or both of the return values may be omitted; no output is given when the appropriate branch is left empty: </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#ifexpr</span><span class="p">:</span> 1 > 0 <span class="p">|</span> yes <span class="p">}}</span></code> → <b>yes</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#ifexpr</span><span class="p">:</span> 1 < 0 <span class="p">|</span> yes <span class="p">}}</span></code> → <b> </b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#ifexpr</span><span class="p">:</span> 0 = 0 <span class="p">|</span> yes <span class="p">}}</span></code> → <b> yes</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#ifexpr</span><span class="p">:</span> 1 > 0 <span class="p">|</span> <span class="p">|</span> no<span class="p">}}</span></code> → <b> </b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#ifexpr</span><span class="p">:</span> 1 < 0 <span class="p">|</span> <span class="p">|</span> no<span class="p">}}</span></code> → <b> no</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#ifexpr</span><span class="p">:</span> 1 > 0 <span class="p">}}</span></code> → <b> </b></dd></dl> <p>Boolean operators of equality or inequality operators are supported. </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#ifexpr</span><span class="p">:</span> 0 = 0 or 1 = 0 <span class="p">|</span> yes<span class="p">}}</span></code> → <b>yes</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#ifexpr</span><span class="p">:</span> 0 = 0 and 1 = 0 <span class="p">|</span> <span class="p">|</span> no<span class="p">}}</span></code> → <b>no</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#ifexpr</span><span class="p">:</span> 2 > 0 or 1 < 0 <span class="p">|</span> yes<span class="p">}}</span></code> → <b>yes</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#ifexpr</span><span class="p">:</span> 2 > 0 and 1 > 0 <span class="p">|</span> yes <span class="p">|</span> no<span class="p">}}</span></code> → <b>yes</b></dd></dl> <table class="warning-message" style="background-color: var( --background-color-error-subtle, #ffe9e5 ); color: var( --color-base, #202122 ); border: 1px var( --border-color-error, #9f3526 ) solid; box-sizing: border-box; margin: 0.5em 0; padding: 0.5em;"><tbody><tr><td style="white-space: nowrap; vertical-align: top;"><span style="position: relative; top: -2px;"><span typeof="mw:File"><span><img alt="Warning" src="//upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/18px-OOjs_UI_icon_notice-destructive.svg.png" decoding="async" width="18" height="18" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/27px-OOjs_UI_icon_notice-destructive.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/36px-OOjs_UI_icon_notice-destructive.svg.png 2x" data-file-width="20" data-file-height="20"/></span></span></span> <b>Warning:</b> </td><td style="padding-left: 0.5em vertical-align: top;">The results of numerical comparisons with <code><a href="##ifexpr">#ifexpr</a></code> do not always match those of <code><a href="##ifeq">#ifeq</a></code> and <code><a href="##switch">#switch</a></code>. These latter two are more accurate than <code><a href="##ifexpr">#ifexpr</a></code>, and so may not return equivalent results. <p>Consider these comparisons with the final digit changed: </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#ifeq</span><span class="p">:</span> 12345678901234567 <span class="p">|</span> 12345678901234568 <span class="p">|</span> equal <span class="p">|</span> not equal<span class="p">}}</span></code> → <b>not equal</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#switch</span><span class="p">:</span> 12345678901234567 <span class="p">|</span><span class="nl"> 12345678901234568 </span><span class="o">=</span> equal <span class="p">|</span> not equal<span class="p">}}</span></code> → <b>not equal</b></dd></dl> <p>Because PHP used in <code><a href="##ifeq">#ifeq</a></code> and <code><a href="##switch">#switch</a></code> compares two numbers of type integer, it returns the expected result correctly. Whereas with <code><a href="##ifexpr">#ifexpr</a></code> and the same numbers: </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#ifexpr</span><span class="p">:</span> 12345678901234567 = 12345678901234568 <span class="p">|</span> equal <span class="p">|</span> not equal<span class="p">}}</span></code> → <b>equal</b></dd></dl> <p>With the different digit, the result of equal is actually incorrect. </p> This behaviour in <code><a href="##ifexpr">#ifexpr</a></code> is caused because MediaWiki converts literal numbers in expressions to type float, which, for large integers like these, involves rounding.<br/><br/></td></tr></tbody></table> <p><span class="anchor" id="ifexist"></span><span class="anchor" id="Ifexist"></span><span class="anchor" id="ifExist"></span><span class="anchor" id="IfExist"></span><span class="anchor" id="IFexist"></span><span class="anchor" id="IFEXIST"></span> </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="#ifexist" data-mw-thread-id="h-#ifexist"><span id=".23ifexist"></span><span data-mw-comment-start="" id="h-#ifexist"></span>#ifexist<span data-mw-comment-end="h-#ifexist"></span></h2><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-#ifexist","replies":["h-ifexist_limits-#ifexist","h-ifexist_and_wanted_pages-#ifexist"]}}--></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r6353907"><div role="note" class="hatnote">See <a href="/wiki/Manual:Checking_for_page_existence" title="Manual:Checking for page existence">Manual:Checking for page existence</a> for other methods of checking if a page exists with different limitations</div> <p>This function takes an input string, interprets it as a page title, and returns one of two values depending on whether or not the page exists on the local wiki. </p> <dl><dd><code>{{#ifexist: <i>page title</i> | <i>value if exists</i> | <i>value if doesn't exist</i> }}</code></dd></dl> <p>The function evaluates to <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="k">true</span></code> if the page exists, whether it contains content, is visibly blank (contains meta-data such as category links or <a href="/wiki/Special:MyLanguage/Help:Magic_words" title="Special:MyLanguage/Help:Magic words">magic words</a><span style="display:none"><a href="/wiki/Help:Magic_words" title="Help:Magic words"> </a></span>, but no visible content), is blank, or is a <a href="/wiki/Special:MyLanguage/Help:Redirects" title="Special:MyLanguage/Help:Redirects">redirect</a><span style="display:none"><a href="/wiki/Help:Redirects" title="Help:Redirects"> </a></span>. Only pages that are redlinked evaluate to <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="k">false</span></code>, including if the page used to exist but has been deleted. </p> <dl><dd><code>{{#ifexist: Help:Extension:ParserFunctions | exists | doesn't exist }}</code> → <b>exists</b></dd> <dd><code>{{#ifexist: XXHelp:Extension:ParserFunctionsXX | exists | doesn't exist }}</code> → <b>doesn't exist</b></dd></dl> <p>The function evaluates to <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="k">true</span></code> for <a href="/wiki/Special:MyLanguage/Help:System_message" title="Special:MyLanguage/Help:System message">system messages</a><span style="display:none"><a href="/wiki/Help:System_message" title="Help:System message"> </a></span> that have been customized, and for <a href="/wiki/Special:MyLanguage/Help:Special_pages" title="Special:MyLanguage/Help:Special pages">special pages</a><span style="display:none"><a href="/wiki/Help:Special_pages" title="Help:Special pages"> </a></span> that are defined by the software. </p> <dl><dd><code>{{#ifexist: Special:Watchlist | exists | doesn't exist }}</code> → <b>exists</b></dd> <dd><code>{{#ifexist: Special:CheckUser | exists | doesn't exist }}</code> → <b>exists</b> (because the <a href="/wiki/Special:MyLanguage/Extension:Checkuser" title="Special:MyLanguage/Extension:Checkuser">Checkuser</a><span style="display:none"><a href="/wiki/Extension:Checkuser" class="mw-redirect" title="Extension:Checkuser"> </a></span> extension is installed on this wiki)</dd> <dd><code>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</code> → <b>doesn't exist</b> (because <a href="/wiki/MediaWiki:Copyright" title="MediaWiki:Copyright">MediaWiki:Copyright</a> has not been customized)</dd></dl> <p>If a page checks a target using <code>#ifexist:</code>, then that page will appear in the <a href="/wiki/Special:WhatLinksHere" title="Special:WhatLinksHere">Special:WhatLinksHere</a> list for the target page. So if the code <code>{{#ifexist:Foo }}</code> were included live on this page (Help:Extension:ParserFunctions), <a href="/wiki/Special:WhatLinksHere/Foo" title="Special:WhatLinksHere/Foo">Special:WhatLinksHere/Foo</a> will list Help:Extension:ParserFunctions. </p><p>On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </p> <dl><dd><code>{{#ifexist: File:Example.png | exists | doesn't exist }}</code> → <b>doesn't exist</b></dd> <dd><code>{{#ifexist: Image:Example.png | exists | doesn't exist }}</code> → <b>doesn't exist</b></dd> <dd><code>{{#ifexist: Media:Example.png | exists | doesn't exist }}</code> → <b>exists</b></dd></dl> <p>If a local description page has been created for the file, the result is <b>exists</b> for all of the above. </p><p><code>#ifexist:</code> does not work with interwiki links. </p> <div class="mw-heading mw-heading3"><h3 id="ifexist_limits" data-mw-thread-id="h-ifexist_limits-#ifexist"><span data-mw-comment-start="" id="h-ifexist_limits-#ifexist"></span>ifexist limits<span data-mw-comment-end="h-ifexist_limits-#ifexist"></span></h3></div> <p><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates). When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into <a href="/wiki/Category:Pages_with_too_many_expensive_parser_function_calls" title="Category:Pages with too many expensive parser function calls">Category:Pages with too many expensive parser function calls</a>. The name of the <a href="/wiki/Special:MyLanguage/Help:Tracking_categories" title="Special:MyLanguage/Help:Tracking categories">tracking category</a><span style="display:none"><a href="/wiki/Help:Tracking_categories" title="Help:Tracking categories"> </a></span> may vary depending on the content language of your wiki. </p><p>For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to unexisting pages) or <code>a:not(.new)</code> (to select links to existing pages). Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code><a href="/wiki/Special:MyLanguage/Manual:$wgExpensiveParserFunctionLimit" title="Special:MyLanguage/Manual:$wgExpensiveParserFunctionLimit">$wgExpensiveParserFunctionLimit</a><span style="display:none"><a href="/wiki/Manual:$wgExpensiveParserFunctionLimit" title="Manual:$wgExpensiveParserFunctionLimit"> </a></span></code>, one can also increase the limit in LocalSettings.php if needed. </p> <div class="mw-heading mw-heading3"><h3 id="ifexist_and_wanted_pages" data-mw-thread-id="h-ifexist_and_wanted_pages-#ifexist"><span data-mw-comment-start="" id="h-ifexist_and_wanted_pages-#ifexist"></span>ifexist and wanted pages<span data-mw-comment-end="h-ifexist_and_wanted_pages-#ifexist"></span></h3></div> <p>A page that does not exist and is tested for using #ifexist will end up on the <a href="/wiki/Special:MyLanguage/Manual:WantedPages" title="Special:MyLanguage/Manual:WantedPages">Wanted Pages</a>. See <a href="https://phabricator.wikimedia.org/T14019" class="extiw" title="phabricator:T14019">task T14019</a> for the reason, and <a href="https://en.wikipedia.org/wiki/Template:Linkless_exists" class="extiw" title="w:Template:Linkless exists">w:Template:Linkless exists</a> for a workaround. </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="#rel2abs" data-mw-thread-id="h-#rel2abs"><span id=".23rel2abs"></span><span data-mw-comment-start="" id="h-#rel2abs"></span>#rel2abs<span data-mw-comment-end="h-#rel2abs"></span></h2><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-#rel2abs","replies":[]}}--></div> <p>This function converts a relative file path into an absolute filepath. </p> <dl><dd><code>{{#rel2abs: <i>path</i> }}</code></dd> <dd><code>{{#rel2abs: <i>path</i> | <i>base path</i> }}</code></dd></dl> <p>Within the <code>path</code> input, the following syntax is valid: </p> <ul><li><code>.</code> → the current level</li> <li><code>..</code> → go up one level</li> <li><code>/foo</code> → go down one level into the subdirectory /foo</li></ul> <p>If the <code>base path</code> is not specified, the full page name of the page will be used instead: </p> <dl><dd><code>{{#rel2abs: /quok | Help:Foo/bar/baz }}</code> → <b>Help:Foo/bar/baz/quok</b></dd> <dd><code>{{#rel2abs: ./quok | Help:Foo/bar/baz }}</code> → <b>Help:Foo/bar/baz/quok</b></dd> <dd><code>{{#rel2abs: ../quok | Help:Foo/bar/baz }}</code> → <b>Help:Foo/bar/quok</b></dd> <dd><code>{{#rel2abs: ../. | Help:Foo/bar/baz }}</code> → <b>Help:Foo/bar</b></dd></dl> <p>Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored. Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements: </p> <dl><dd><code>{{#rel2abs: ../quok/. | Help:Foo/bar/baz }}</code> → <b>Help:Foo/bar/quok</b></dd> <dd><code>{{#rel2abs: ../../quok | Help:Foo/bar/baz }}</code> → <b>Help:Foo/quok</b></dd> <dd><code>{{#rel2abs: ../../../quok | Help:Foo/bar/baz }}</code> → <b>quok</b></dd> <dd><code>{{#rel2abs: ../../../../quok | Help:Foo/bar/baz }}</code> → <b><strong class="error">Error: Invalid depth in path: "Help:Foo/bar/baz/../../../../quok" (tried to access a node above the root node).</strong></b></dd></dl> <p>For a similar group of functions see also <a href="/wiki/Special:MyLanguage/Help:Magic_words#URL_data" title="Special:MyLanguage/Help:Magic words">Help:Magic words#URL data</a>. Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc. </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="#switch" data-mw-thread-id="h-#switch"><span id=".23switch"></span><span data-mw-comment-start="" id="h-#switch"></span>#switch<span data-mw-comment-end="h-#switch"></span></h2><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-#switch","replies":["h-Default-#switch","h-Grouping_results-#switch","h-Use_with_parameters-#switch","h-Comparison_behavior-#switch","h-Raw_equal_signs-#switch","h-Replacing_#ifeq-#switch"]}}--></div> <p><i>See also: <a href="https://en.wikipedia.org/wiki/Help:Switch_parser_function" class="extiw" title="w:Help:Switch parser function">w:Help:Switch parser function</a></i> </p><p>This function compares one input value against several test cases, returning an associated string if a match is found. </p> <pre style="white-space:pre-wrap">{{#switch: <i>comparison string</i> | <i>case</i> = <i>result</i> | <i>case</i> = <i>result</i> | <i>...</i> | <i>case</i> = <i>result</i> | <i>default result</i> }}</pre> <p>Examples: </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#switch</span><span class="p">:</span> baz <span class="p">|</span><span class="nl"> foo </span><span class="o">=</span> Foo <span class="p">|</span><span class="nl"> baz </span><span class="o">=</span> Baz <span class="p">|</span> Bar <span class="p">}}</span></code> → <b> Baz </b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#switch</span><span class="p">:</span> foo <span class="p">|</span><span class="nl"> foo </span><span class="o">=</span> Foo <span class="p">|</span><span class="nl"> baz </span><span class="o">=</span> Baz <span class="p">|</span> Bar <span class="p">}}</span></code> → <b> Foo </b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#switch</span><span class="p">:</span> zzz <span class="p">|</span><span class="nl"> foo </span><span class="o">=</span> Foo <span class="p">|</span><span class="nl"> baz </span><span class="o">=</span> Baz <span class="p">|</span> Bar <span class="p">}}</span></code> → <b> Bar </b></dd></dl> <p>#switch with partial transclusion tags can affect a configuration file that enables an editor unfamiliar with template coding to view and edit configurable elements. </p> <div class="mw-heading mw-heading3"><h3 id="Default" data-mw-thread-id="h-Default-#switch"><span data-mw-comment-start="" id="h-Default-#switch"></span>Default<span data-mw-comment-end="h-Default-#switch"></span></h3></div> <p>The <code><i>default result</i></code> is returned if no <code><i>case</i></code> string matches the <code><i>comparison string</i></code>: </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#switch</span><span class="p">:</span> test <span class="p">|</span><span class="nl"> foo </span><span class="o">=</span> Foo <span class="p">|</span><span class="nl"> baz </span><span class="o">=</span> Baz <span class="p">|</span> Bar <span class="p">}}</span></code> → <b> Bar </b></dd></dl> <p>In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code>{{}}</code>). If it does, it will be treated as a case comparison, and no text will display if no cases match. This is because the default value has not been defined (is empty). If a case matches however, its associated string will be returned. </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#switch</span><span class="p">:</span> test <span class="p">|</span> Bar <span class="p">|</span><span class="nl"> foo </span><span class="o">=</span> Foo <span class="p">|</span><span class="nl"> baz </span><span class="o">=</span> Baz <span class="p">}}</span></code> → <b> </b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#switch</span><span class="p">:</span> test <span class="p">|</span><span class="nl"> foo </span><span class="o">=</span> Foo <span class="p">|</span><span class="nl"> baz </span><span class="o">=</span> Baz <span class="p">|</span><span class="nl"> B</span><span class="o">=</span>ar <span class="p">}}</span></code> → <b> </b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#switch</span><span class="p">:</span> test <span class="p">|</span><span class="nl"> test </span><span class="o">=</span> Foo <span class="p">|</span><span class="nl"> baz </span><span class="o">=</span> Baz <span class="p">|</span><span class="nl"> B</span><span class="o">=</span>ar <span class="p">}}</span></code> → <b> Foo </b></dd></dl> <p>Alternatively, the default result may be explicitly declared with a <code><i>case</i></code> string of "<code>#default</code>". </p> <pre style="white-space:pre-wrap">{{#switch: <i>comparison string</i> | <i>case</i> = <i>result</i> | <i>case</i> = <i>result</i> | <i>...</i> | <i>case</i> = <i>result</i> | #default = <i>default result</i> }}</pre> <p>Default results declared in this way may be placed anywhere within the function: </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#switch</span><span class="p">:</span> test <span class="p">|</span><span class="nl"> foo </span><span class="o">=</span> Foo <span class="p">|</span><span class="nl"> #default </span><span class="o">=</span> Bar <span class="p">|</span><span class="nl"> baz </span><span class="o">=</span> Baz <span class="p">}}</span></code> → <b> Bar </b></dd></dl> <p>If the <code><i>default</i></code> parameter is omitted and no match is made, no <code><i>result</i></code> is returned: </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#switch</span><span class="p">:</span> test <span class="p">|</span><span class="nl"> foo </span><span class="o">=</span> Foo <span class="p">|</span><span class="nl"> baz </span><span class="o">=</span> Baz <span class="p">}}</span></code> → <b> </b></dd></dl> <div class="mw-heading mw-heading3"><h3 id="Grouping_results" data-mw-thread-id="h-Grouping_results-#switch"><span data-mw-comment-start="" id="h-Grouping_results-#switch"></span>Grouping results<span data-mw-comment-end="h-Grouping_results-#switch"></span></h3></div> <p>It is possible to have 'fall through' values, where several <code><i>case</i></code> strings return the same <code><i>result</i></code> string. This minimizes duplication. </p> <pre style="white-space:pre-wrap">{{#switch: <i>comparison string</i> | <i>case1</i> = <i>result1</i> | <i>case2</i> | <i>case3</i> | <i>case4</i> = <i>result234</i> | <i>case5</i> = <i>result5</i> | <i>case6</i> | <i>case7</i> = <i>result67</i> | #default = <i>default result</i> }}</pre> <p>Here cases 2, 3 and 4 all return <code><i>result234</i></code>; cases 6 and 7 both return <code><i>result67</i></code>. The "<code>#default = </code>" in the last parameter may be omitted in the above case. </p> <div class="mw-heading mw-heading3"><h3 id="Use_with_parameters" data-mw-thread-id="h-Use_with_parameters-#switch"><span data-mw-comment-start="" id="h-Use_with_parameters-#switch"></span>Use with parameters<span data-mw-comment-end="h-Use_with_parameters-#switch"></span></h3></div> <p>The function may be used with parameters as the test string. In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code>{{{<i>parameter name</i>}}}</code>". (This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value. See <a href="/wiki/Special:MyLanguage/Help:Parser_functions_in_templates" title="Special:MyLanguage/Help:Parser functions in templates">Help:Parser functions in templates</a><span style="display:none"><a href="/wiki/Help:Parser_functions_in_templates" title="Help:Parser functions in templates"> </a></span>.) </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#switch</span><span class="p">:</span> <span class="p">{{{</span><span class="nv">1</span><span class="p">}}}</span> <span class="p">|</span><span class="nl"> foo </span><span class="o">=</span> Foo <span class="p">|</span><span class="nl"> baz </span><span class="o">=</span> Baz <span class="p">|</span> Bar <span class="p">}}</span></code></dd></dl> <p>In the above case, if <code>{{{1}}}</code> equals <code>foo</code>, the function will return <code>Foo</code>. If it equals <code>baz</code>, the function will return <code>Baz</code>. If the parameter is empty or does not exist, the function will return <code>Bar</code>. </p><p>As in the section above, cases can be combined to give a single result. </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#switch</span><span class="p">:</span> <span class="p">{{{</span><span class="nv">1</span><span class="p">}}}</span> <span class="p">|</span> foo <span class="p">|</span> zoo <span class="p">|</span><span class="nl"> roo </span><span class="o">=</span> Foo <span class="p">|</span><span class="nl"> baz </span><span class="o">=</span> Baz <span class="p">|</span> Bar <span class="p">}}</span></code></dd></dl> <p>Here, if <code>{{{1}}}</code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>. If it equals <code>baz</code>, the function will return <code>Baz</code>. If the parameter is empty or does not exist, the function will return <code>Bar</code>. </p><p>Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#switch</span><span class="p">:</span> <span class="p">{{{</span><span class="nv">1</span><span class="p">}}}</span> <span class="p">|</span><span class="nl"> foo </span><span class="o">=</span> Foo <span class="p">|</span><span class="nl"> bar </span><span class="o">=</span> Bar <span class="p">}}</span></code></dd></dl> <p>In this case, the function returns an empty string unless <code>{{{1}}}</code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </p><p>This has the same effect as declaring the default result as empty. </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#switch</span><span class="p">:</span> <span class="p">{{{</span><span class="nv">1</span><span class="p">}}}</span> <span class="p">|</span> foo <span class="p">|</span> zoo <span class="p">|</span><span class="nl"> roo </span><span class="o">=</span> Foo <span class="p">|</span><span class="nl"> baz </span><span class="o">=</span> Baz <span class="p">|</span> <span class="p">}}</span></code></dd></dl> <p>If for some reason you decide to set a case as "<code>{{{<i>parameter name</i>}}}</code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value. The parameter would have to exist and have a value other than the string "<code>{{{<i>parameter name</i>}}}</code>" to return the function's default result. </p> <dl><dd>(when <code>{{{1}}}</code> doesn't exist or is empty): <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#switch</span><span class="p">:</span> <span class="p">{{{</span><span class="nv">1</span><span class="p">}}}</span> <span class="p">|</span> <span class="p">{{{</span><span class="nv">1</span><span class="p">}}}</span> = Foo <span class="p">|</span><span class="nl"> baz </span><span class="o">=</span> Baz <span class="p">|</span> Bar <span class="p">}}</span></code> → <b> Foo </b></dd></dl></dd> <dd>(when <code>{{{1}}}</code> has the value "<code>test</code>"): <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#switch</span><span class="p">:</span> <span class="p">{{{</span><span class="nv">1</span><span class="p">}}}</span> <span class="p">|</span> <span class="p">{{{</span><span class="nv">1</span><span class="p">}}}</span> = Foo <span class="p">|</span><span class="nl"> baz </span><span class="o">=</span> Baz <span class="p">|</span> Bar <span class="p">}}</span></code> → <b> Bar </b></dd></dl></dd> <dd>(when <code>{{{1}}}</code> has the value "<code>{{{1}}}</code>"): <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#switch</span><span class="p">:</span> <span class="p">{{{</span><span class="nv">1</span><span class="p">}}}</span> <span class="p">|</span> <span class="p">{{{</span><span class="nv">1</span><span class="p">}}}</span> = Foo <span class="p">|</span><span class="nl"> baz </span><span class="o">=</span> Baz <span class="p">|</span> Bar <span class="p">}}</span></code> → <b> Foo </b></dd></dl></dd></dl> <p>In this hypothetical case, you would need to add the pipe to the parameter (<code>{{{1<span style="color:red; font-weight:bold">|</span>}}}</code>). </p> <div class="mw-heading mw-heading3"><h3 id="Comparison_behavior" data-mw-thread-id="h-Comparison_behavior-#switch"><span data-mw-comment-start="" id="h-Comparison_behavior-#switch"></span>Comparison behavior<span data-mw-comment-end="h-Comparison_behavior-#switch"></span></h3></div> <p>As with <code><a href="##ifeq">#ifeq</a></code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#switch</span><span class="p">:</span> 0 + 1 <span class="p">|</span><span class="nl"> 1 </span><span class="o">=</span> one <span class="p">|</span><span class="nl"> 2 </span><span class="o">=</span> two <span class="p">|</span> three<span class="p">}}</span></code> → <b>three</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#switch</span><span class="p">:</span> <span class="p">{{</span><span class="nf">#expr</span><span class="p">:</span> 0 + 1<span class="p">}}</span> <span class="p">|</span><span class="nl"> 1 </span><span class="o">=</span> one <span class="p">|</span><span class="nl"> 2 </span><span class="o">=</span> two <span class="p">|</span> three<span class="p">}}</span></code> → <b>one</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#switch</span><span class="p">:</span> 02 <span class="p">|</span><span class="nl"> +1 </span><span class="o">=</span> one <span class="p">|</span><span class="nl"> +2 </span><span class="o">=</span> two <span class="p">|</span> three<span class="p">}}</span></code> → <b>two</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#switch</span><span class="p">:</span> 100 <span class="p">|</span><span class="nl"> 1e1 </span><span class="o">=</span> ten <span class="p">|</span><span class="nl"> 1e2 </span><span class="o">=</span> hundred <span class="p">|</span> other<span class="p">}}</span></code> → <b>hundred</b></dd></dl> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#switch</span><span class="p">:</span> a <span class="p">|</span><span class="nl"> a </span><span class="o">=</span> A <span class="p">|</span><span class="nl"> b </span><span class="o">=</span> B <span class="p">|</span> C<span class="p">}}</span></code> → <b>A</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#switch</span><span class="p">:</span> A <span class="p">|</span><span class="nl"> a </span><span class="o">=</span> A <span class="p">|</span><span class="nl"> b </span><span class="o">=</span> B <span class="p">|</span> C<span class="p">}}</span></code> → <b>C</b></dd></dl> <p>A <code><i>case</i></code> string may be empty: </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#switch</span><span class="p">:</span> <span class="p">|</span><span class="nl"> </span><span class="o">=</span> Nothing <span class="p">|</span><span class="nl"> foo </span><span class="o">=</span> Foo <span class="p">|</span> Something <span class="p">}}</span></code> → <b>Nothing</b></dd></dl> <p>Once a match is found, subsequent <code><i>cases</i></code> are ignored: </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#switch</span><span class="p">:</span> b <span class="p">|</span><span class="nl"> f </span><span class="o">=</span> Foo <span class="p">|</span><span class="nl"> b </span><span class="o">=</span> Bar <span class="p">|</span><span class="nl"> b </span><span class="o">=</span> Baz <span class="p">|</span> <span class="p">}}</span></code> → <b>Bar</b></dd></dl> <table class="warning-message" style="background-color: var( --background-color-error-subtle, #ffe9e5 ); color: var( --color-base, #202122 ); border: 1px var( --border-color-error, #9f3526 ) solid; box-sizing: border-box; margin: 0.5em 0; padding: 0.5em;"><tbody><tr><td style="white-space: nowrap; vertical-align: top;"><span style="position: relative; top: -2px;"><span typeof="mw:File"><span><img alt="Warning" src="//upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/18px-OOjs_UI_icon_notice-destructive.svg.png" decoding="async" width="18" height="18" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/27px-OOjs_UI_icon_notice-destructive.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/36px-OOjs_UI_icon_notice-destructive.svg.png 2x" data-file-width="20" data-file-height="20"/></span></span></span> <b>Warning:</b> </td><td style="padding-left: 0.5em vertical-align: top;">Numerical comparisons with <code><a href="##switch">#switch</a></code> and <code><a href="##ifeq">#ifeq</a></code> are not equivalent to comparisons in expressions (see also above): <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#switch</span><span class="p">:</span> 12345678901234567 <span class="p">|</span><span class="nl"> 12345678901234568 </span><span class="o">=</span> A <span class="p">|</span> B<span class="p">}}</span></code> → <b>B</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#ifexpr</span><span class="p">:</span> 12345678901234567 = 12345678901234568 <span class="p">|</span> A <span class="p">|</span> B<span class="p">}}</span></code> → <b>A</b></dd></dl></td></tr></tbody></table> <div class="mw-heading mw-heading3"><h3 id="Raw_equal_signs" data-mw-thread-id="h-Raw_equal_signs-#switch"><span data-mw-comment-start="" id="h-Raw_equal_signs-#switch"></span>Raw equal signs<span data-mw-comment-end="h-Raw_equal_signs-#switch"></span></h3></div> <p>"Case" strings cannot contain raw equals signs. To work around this, use the <a href="/wiki/Special:MyLanguage/Help:Magic_words#Other" title="Special:MyLanguage/Help:Magic words">{{=}}</a> magic word, or replace equals sign with HTML code <code>&#61;</code>. </p><p>Example: </p> <table class="wikitable"> <tbody><tr> <th>You type </th> <th>You get </th></tr> <tr> <td><div class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><pre><span></span><span class="p">{{</span><span class="nf">#switch</span><span class="p">:</span> 1=2 <span class="p">|</span><span class="nl"> 1</span><span class="o">=</span>2 = raw <span class="p">|</span> 1<span class="p"><</span><span class="nt">nowiki</span><span class="p">></span>=<span class="p"></</span><span class="nt">nowiki</span><span class="p">></span>2 = nowiki <span class="p">|</span> 1<span class="p">{{</span><span class="nf">=</span><span class="p">}}</span>2 = template <span class="p">|</span> default <span class="p">}}</span> </pre></div> </td> <td><b>template</b> </td></tr> <tr> <td><div class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><pre><span></span><span class="p">{{</span><span class="nf">#switch</span><span class="p">:</span> 1=2 <span class="p">|</span><span class="nl"> 1&#61;2 </span><span class="o">=</span> html <span class="p">|</span> default <span class="p">}}</span> </pre></div> </td> <td><b>html</b> </td></tr></tbody></table> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r6651107"><div role="note" class="note note-info">For a simple real life example of the use of this function, check <a class="external text" href="https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646">Template:NBA color</a>. Two complex examples can be found at <a href="/wiki/Special:MyLanguage/Template:Extension" title="Special:MyLanguage/Template:Extension">Template:Extension</a><span style="display:none"><a href="/wiki/Template:Extension" title="Template:Extension"> </a></span> and <a href="https://en.wikipedia.org/wiki/Template:BOTREQ" class="extiw" title="w:Template:BOTREQ">w:Template:BOTREQ</a>.</div> <div class="mw-heading mw-heading3"><h3 id="Replacing_#ifeq" data-mw-thread-id="h-Replacing_#ifeq-#switch"><span id="Replacing_.23ifeq"></span><span data-mw-comment-start="" id="h-Replacing_#ifeq-#switch"></span>Replacing #ifeq<span data-mw-comment-end="h-Replacing_#ifeq-#switch"></span></h3></div> <p><code>#switch</code> can be used to reduce <a href="/wiki/Special:MyLanguage/Help:Expansion_depth" title="Special:MyLanguage/Help:Expansion depth">expansion depth</a>. </p><p>For example: </p> <ul><li><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#switch</span><span class="p">:{{{</span><span class="nv">1</span><span class="p">}}}</span> <span class="p">|</span><span class="nl">condition1</span><span class="o">=</span>branch1 <span class="p">|</span><span class="nl">condition2</span><span class="o">=</span>branch2 <span class="p">|</span><span class="nl">condition3</span><span class="o">=</span>branch3 <span class="p">|</span>branch4<span class="p">}}</span></code></li></ul> <p>is equivalent to </p> <ul><li><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#ifeq</span><span class="p">:{{{</span><span class="nv">1</span><span class="p">}}}|</span>condition1 <span class="p">|</span>branch1 <span class="p">|{{</span><span class="nf">#ifeq</span><span class="p">:{{{</span><span class="nv">1</span><span class="p">}}}|</span>condition2 <span class="p">|</span>branch2 <span class="p">|{{</span><span class="nf">#ifeq</span><span class="p">:{{{</span><span class="nv">1</span><span class="p">}}}|</span>condition3 <span class="p">|</span>branch3 <span class="p">|</span>branch4<span class="p">}}}}}}</span></code></li></ul> <p>i.e. deep nesting, linear: </p> <div class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><pre><span></span><span class="p">{{</span><span class="nf">#ifeq</span><span class="p">:{{{</span><span class="nv">1</span><span class="p">}}}|</span>condition1 <span class="p">|</span><span class="cm"><!--then--></span>branch1 <span class="p">|</span><span class="cm"><!--else--></span><span class="p">{{</span><span class="nf">#ifeq</span><span class="p">:{{{</span><span class="nv">1</span><span class="p">}}}|</span>condition2 <span class="p">|</span><span class="cm"><!--then--></span>branch2 <span class="p">|</span><span class="cm"><!--else--></span><span class="p">{{</span><span class="nf">#ifeq</span><span class="p">:{{{</span><span class="nv">1</span><span class="p">}}}|</span>condition3 <span class="p">|</span><span class="cm"><!--then--></span>branch3 <span class="p">|</span><span class="cm"><!--else--></span>branch4<span class="p">}}}}}}</span> </pre></div> <p>On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </p> <div class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><pre><span></span><span class="p">{{</span><span class="nf">#ifeq</span><span class="p">:{{{</span><span class="nv">1</span><span class="p">}}}|</span>condition1 <span class="p">|</span><span class="cm"><!--then--></span>branch1t<span class="p">{{</span> <span class="w"> </span><span class="nf">#ifeq</span><span class="p">:{{{</span><span class="nv">1</span><span class="p">}}}|</span>condition2 <span class="p">|</span><span class="cm"><!--then--></span>branch1t2t<span class="p">{{</span><span class="nf">#ifeq</span><span class="p">:{{{</span><span class="nv">1</span><span class="p">}}}|</span>condition4<span class="p">|</span><span class="cm"><!--then--></span>branch1t2t4t<span class="p">|</span><span class="cm"><!--else--></span>branch1t2t4e<span class="p">}}</span> <span class="p">|</span><span class="cm"><!--else--></span>branch1t2e<span class="p">{{</span><span class="nf">#ifeq</span><span class="p">:{{{</span><span class="nv">1</span><span class="p">}}}|</span>condition5<span class="p">|</span><span class="cm"><!--then--></span>branch1t2e5t<span class="p">|</span><span class="cm"><!--else--></span>branch1t2e5e<span class="p">}}</span> <span class="p">}}</span> <span class="p">|</span><span class="cm"><!--else--></span>branch1e<span class="p">{{</span><span class="nf">#ifeq</span><span class="p">:{{{</span><span class="nv">1</span><span class="p">}}}|</span>condition3 <span class="p">|</span><span class="cm"><!--then--></span>branch1e3t<span class="p">{{</span><span class="nf">#ifeq</span><span class="p">:{{{</span><span class="nv">1</span><span class="p">}}}|</span>condition6<span class="p">|</span>branch1e3t6t<span class="p">|</span>branch1e3t6e<span class="p">}}</span> <span class="p">|</span><span class="cm"><!--else--></span>branch1e3e<span class="p">{{</span> <span class="w"> </span><span class="nf">#ifeq</span><span class="p">:{{{</span><span class="nv">1</span><span class="p">}}}|</span>condition7 <span class="p">|</span>branch1e3e7t <span class="p">|</span>branch1e3e7t <span class="p">}}</span> <span class="p">}}</span> <span class="p">}}</span> </pre></div> <p><span class="anchor" id="time"></span><span class="anchor" id="TIME"></span> </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="#time" data-mw-thread-id="h-#time"><span id=".23time"></span><span data-mw-comment-start="" id="h-#time"></span>#time<span data-mw-comment-end="h-#time"></span></h2><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-#time","replies":["h-Time_Zone_issue-#time","h-#time_format_like_in_signatures-#time"]}}--></div> <table class="wikitable plainlinks" style="float: right; font-size: 90%; line-height: normal; margin-left: 1em; width: 40%;"> <tbody><tr> <th style="background:#C5D8FC">Code </th> <th style="background:#C5D8FC">Description </th> <th style="background:#C5D8FC">Current output <br/><small class="noprint">(<a class="external text" href="https://www.mediawiki.org/w/index.php?title=Help:Extension:ParserFunctions&action=purge">Purge this page's cache</a> to update)</small> </th></tr> <tr> <th style="background:#A7C1F2" colspan="3">Year </th></tr> <tr> <td style="text-align: center;"><code>Y</code> </td> <td>4-digit year. </td> <td style="text-align: center;">2024 </td></tr> <tr> <td style="text-align: center;"><code>y</code> </td> <td>2-digit year. </td> <td style="text-align: center;">24 </td></tr> <tr> <td style="text-align: center;"><code>L</code> </td> <td>1 if it's a leap year, 0 if not. </td> <td style="text-align: center;">1 </td></tr> <tr> <td style="text-align: center;"><code>o</code><sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>note 1<span class="cite-bracket">]</span></a></sup> </td> <td>ISO-8601 year of the specified week.<sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>note 2<span class="cite-bracket">]</span></a></sup> </td> <td style="text-align: center;">2024<sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span class="cite-bracket">[</span>note 3<span class="cite-bracket">]</span></a></sup> </td></tr> <tr> <td colspan="3" style="font-size: 88%;"><div class="mw-references-wrap"><ol class="references"> <li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">Requires PHP 5.1.0 and newer and <a href="https://www.mediawiki.org/wiki/Special:Code/MediaWiki/45208" class="extiw" title="rev:45208">rev:45208</a>.</span> </li> <li id="cite_note-2"><span class="mw-cite-backlink"><a href="#cite_ref-2">↑</a></span> <span class="reference-text">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span> </li> <li id="cite_note-3"><span class="mw-cite-backlink"><a href="#cite_ref-3">↑</a></span> <span class="reference-text">Will output literal <i>o</i> if note 1 not fulfilled.</span> </li> </ol></div> </td></tr> <tr> <th style="background:#A7C1F2" colspan="3">Month </th></tr> <tr> <td style="text-align: center;"><code>n</code> </td> <td>Month index, not zero-padded. </td> <td style="text-align: center;">12 </td></tr> <tr> <td style="text-align: center;"><code>m</code> </td> <td>Month index, zero-padded. </td> <td style="text-align: center;">12 </td></tr> <tr> <td style="text-align: center;"><code>M</code> </td> <td>An abbreviation of the month name, in the site language. </td> <td style="text-align: center;">Dec </td></tr> <tr> <td style="text-align: center;"><code>F</code> </td> <td>The full month name in the site language. </td> <td style="text-align: center;">December </td></tr> <tr> <td style="text-align: center;"><code>xg</code> </td> <td>Output the full month name in the <a href="https://en.wikipedia.org/wiki/Genitive_case" class="extiw" title="w:Genitive case">genitive</a> form for site languages that distinguish between genitive and <a href="https://en.wikipedia.org/wiki/Nominative_case" class="extiw" title="w:Nominative case">nominative</a> forms. This option is useful for many <a href="https://en.wikipedia.org/wiki/Slavic_languages" class="extiw" title="w:Slavic languages">Slavic languages</a> like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc. </td> <td style="line-height: 1.6;">For Polish:<br/><code style="font-size: 85%;">{{#time:F Y|June 2010|pl}}</code> → czerwiec 2010<br/>(nominative)<br/><code style="font-size: 85%;">{{#time:d xg Y|20 June 2010|pl}}</code> → 20 czerwca 2010<br/>(genitive) </td></tr> <tr> <th style="background:#A7C1F2" colspan="3">Day of the month or the year </th></tr> <tr> <td style="text-align: center;"><code>j</code> </td> <td>Day of the month, not zero-padded. </td> <td style="text-align: center;">3 </td></tr> <tr> <td style="text-align: center;"><code>d</code> </td> <td>Day of the month, zero-padded. </td> <td style="text-align: center;">03 </td></tr> <tr> <td style="text-align: center;"><code>z</code> </td> <td>Day of the year (January 1 = 0).<br/><span typeof="mw:File"><span><img alt="Note" src="//upload.wikimedia.org/wikipedia/commons/thumb/a/a8/OOjs_UI_icon_lightbulb-yellow.svg/18px-OOjs_UI_icon_lightbulb-yellow.svg.png" decoding="async" width="18" height="18" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/a/a8/OOjs_UI_icon_lightbulb-yellow.svg/27px-OOjs_UI_icon_lightbulb-yellow.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/a/a8/OOjs_UI_icon_lightbulb-yellow.svg/36px-OOjs_UI_icon_lightbulb-yellow.svg.png 2x" data-file-width="20" data-file-height="20"/></span></span> <b>Note:</b> To get the ISO day of the year add 1. </td> <td style="text-align: center;">337 </td></tr> <tr> <th style="background:#A7C1F2" colspan="3">Week and day of the week </th></tr> <tr> <td style="text-align: center;"><code>W</code> </td> <td>ISO 8601 week number, zero-padded. </td> <td style="text-align: center;">49 </td></tr> <tr> <td style="text-align: center;"><code>N</code> </td> <td>ISO 8601 day of the week (Monday = 1, Sunday = 7). </td> <td style="text-align: center;">2 </td></tr> <tr> <td style="text-align: center;"><code>w</code> </td> <td>Number of the day of the week (Sunday = 0, Saturday = 6). </td> <td style="text-align: center;">2 </td></tr> <tr> <td style="text-align: center;"><code>D</code> </td> <td>An abbreviation for the day of the week. Rarely internationalized. </td> <td style="text-align: center;">Tue </td></tr> <tr> <td style="text-align: center;"><code>l</code> </td> <td>The full weekday name. Rarely internationalized. </td> <td style="text-align: center;">Tuesday </td></tr> <tr> <th style="background:#A7C1F2" colspan="3">Hour </th></tr> <tr> <td style="text-align: center;"><code>a</code> </td> <td>"am" during the morning (00:00:00 → 11:59:59), "pm" otherwise (12:00:00 → 23:59:59). </td> <td style="text-align: center;">am </td></tr> <tr> <td style="text-align: center;"><code>A</code> </td> <td>Uppercase version of <code>a</code> above. </td> <td style="text-align: center;">AM </td></tr> <tr> <td style="text-align: center;"><code>g</code> </td> <td>Hour in 12-hour format, not zero-padded. </td> <td style="text-align: center;">1 </td></tr> <tr> <td style="text-align: center;"><code>h</code> </td> <td>Hour in 12-hour format, zero-padded. </td> <td style="text-align: center;">01 </td></tr> <tr> <td style="text-align: center;"><code>G</code> </td> <td>Hour in 24-hour format, not zero-padded. </td> <td style="text-align: center;">1 </td></tr> <tr> <td style="text-align: center;"><code>H</code> </td> <td>Hour in 24-hour format, zero-padded. </td> <td style="text-align: center;">01 </td></tr> <tr> <th style="background:#A7C1F2" colspan="3">Minutes and seconds </th></tr> <tr> <td style="text-align: center;"><code>i</code> </td> <td>Minutes past the hour, zero-padded. </td> <td style="text-align: center;">33 </td></tr> <tr> <td style="text-align: center;"><code>s</code> </td> <td>Seconds past the minute, zero-padded. </td> <td style="text-align: center;">40 </td></tr> <tr> <td style="text-align: center;"><code>U</code> </td> <td><a href="https://en.wikipedia.org/wiki/Unix_time" class="extiw" title="w:Unix time">Unix time</a>. Seconds since January 1 1970 00:00:00 GMT. </td> <td style="text-align: center;">1733189620 </td></tr> <tr> <th id="TimeZone" style="background:#A7C1F2" colspan="3">Timezone (as of <a href="/wiki/MediaWiki_1.22/Roadmap" title="MediaWiki 1.22/Roadmap">1.22wmf2</a>) </th></tr> <tr> <td style="text-align: center;"><code>e</code> </td> <td>Timezone identifier. </td> <td style="text-align: center;">UTC </td></tr> <tr> <td style="text-align: center;"><code>I</code> </td> <td>Whether or not the date is in daylight savings time. </td> <td style="text-align: center;">0 </td></tr> <tr> <td style="text-align: center;"><code>O</code> </td> <td>Difference to Greenwich time (GMT) </td> <td style="text-align: center;">+0000 </td></tr> <tr> <td style="text-align: center;"><code>P</code> </td> <td>Difference to Greenwich time (GMT), with colon </td> <td style="text-align: center;">+00:00 </td></tr> <tr> <td style="text-align: center;"><code>T</code> </td> <td>Timezone abbreviation. </td> <td style="text-align: center;">UTC </td></tr> <tr> <td style="text-align: center;"><code>Z</code> </td> <td>Timezone offset in seconds. </td> <td style="text-align: center;">0 </td></tr> <tr> <th style="background:#A7C1F2" colspan="3">Miscellaneous </th></tr> <tr> <td style="text-align: center;"><code>t</code> </td> <td>Number of days in the current month. </td> <td style="text-align: center;">31 </td></tr> <tr> <td style="text-align: center;"><code>c</code> </td> <td>ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>. </td> <td style="font-size: 75%;">2024-12-03T01:33:40+00:00 </td></tr> <tr> <td style="text-align: center;"><code>r</code> </td> <td><a href="//tools.ietf.org/html/rfc5322" class="extiw" title="rfc:5322">RFC 5322</a> formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized. </td> <td style="font-size: 75%;">Tue, 03 Dec 2024 01:33:40 +0000 </td></tr> <tr> <th style="background:#A7C1F2" colspan="3">Non-Gregorian calendars </th></tr> <tr> <th style="background:#8DA7D6; color:black;" colspan="3">Islamic </th></tr> <tr> <td style="text-align: center;"><code>xmj</code> </td> <td>Day of the month. </td> <td>1 </td></tr> <tr> <td style="text-align: center;"><code>xmF</code> </td> <td>Full month name. </td> <td>Jumada al-thani </td></tr> <tr> <td style="text-align: center;"><code>xmn</code> </td> <td>Month index. </td> <td>6 </td></tr> <tr> <td style="text-align: center;"><code>xmY</code> </td> <td>Full year. </td> <td>1446 </td></tr> <tr> <th style="background:#8DA7D6; color:black;" colspan="3">Iranian (Jalaly) </th></tr> <tr> <td style="text-align: center;"><code>xit</code> </td> <td>Number of days in the month. </td> <td>30 </td></tr> <tr> <td style="text-align: center;"><code>xiz</code> </td> <td>Day of the year. </td> <td>258 </td></tr> <tr> <td style="text-align: center;"><code>xij</code> </td> <td>Day of the month. </td> <td>13 </td></tr> <tr> <td style="text-align: center;"><code>xiF</code> </td> <td>Full month name. </td> <td>Azar </td></tr> <tr> <td style="text-align: center;"><code>xin</code> </td> <td>Month index. </td> <td>9 </td></tr> <tr> <td style="text-align: center;"><code>xiY</code> </td> <td>Full year. </td> <td>1403 </td></tr> <tr> <td style="text-align: center;"><code>xiy</code> </td> <td>2-digit year. </td> <td>03 </td></tr> <tr> <th style="background:#8DA7D6; color:black;" colspan="3">Hebrew </th></tr> <tr> <td style="text-align: center;"><code>xjj</code> </td> <td>Day of the month. </td> <td>2 </td></tr> <tr> <td style="text-align: center;"><code>xjF</code> </td> <td>Full month name. </td> <td>Kislev </td></tr> <tr> <td style="text-align: center;"><code>xjt</code> </td> <td>Number of days in month. </td> <td>30 </td></tr> <tr> <td style="text-align: center;"><code>xjx</code> </td> <td>Genitive form of the month name. </td> <td>Kislev </td></tr> <tr> <td style="text-align: center;"><code>xjn</code> </td> <td>Month number. </td> <td>3 </td></tr> <tr> <td style="text-align: center;"><code>xjY</code> </td> <td>Full year. </td> <td>5785 </td></tr> <tr> <th style="background:#8DA7D6; color:black;" colspan="3">Thai solar </th></tr> <tr> <td style="text-align: center;"><code>xkY</code> </td> <td>Full year in <a href="https://en.wikipedia.org/wiki/Thai_solar_calendar" class="extiw" title="w:Thai solar calendar">Thai solar calendar</a>. <br/><span typeof="mw:File"><span><img alt="Note" src="//upload.wikimedia.org/wikipedia/commons/thumb/a/a8/OOjs_UI_icon_lightbulb-yellow.svg/18px-OOjs_UI_icon_lightbulb-yellow.svg.png" decoding="async" width="18" height="18" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/a/a8/OOjs_UI_icon_lightbulb-yellow.svg/27px-OOjs_UI_icon_lightbulb-yellow.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/a/a8/OOjs_UI_icon_lightbulb-yellow.svg/36px-OOjs_UI_icon_lightbulb-yellow.svg.png 2x" data-file-width="20" data-file-height="20"/></span></span> <b>Note:</b> For years before 1941 the dates in Jan-Mar range are not <a href="https://en.wikipedia.org/wiki/Thai_solar_calendar#New_year" class="extiw" title="w:Thai solar calendar">calculated</a> properly. </td> <td>2567 </td></tr> <tr> <th style="background:#8DA7D6; color:black;" colspan="3">Minguo/Juche year </th></tr> <tr> <td style="text-align: center;"><code>xoY</code> </td> <td>Full year. </td> <td>113 </td></tr> <tr> <th style="background:#8DA7D6; color:black;" colspan="3">Japanese nengo </th></tr> <tr> <td style="text-align: center;"><code>xtY</code> </td> <td>Full year. </td> <td>令和6 </td></tr> <tr> <th style="background:#A7C1F2" colspan="3">Flags </th></tr> <tr> <td style="text-align: center;"><code>xn</code> </td> <td>Format the next numeric code as a raw ASCII number. </td> <td>In the Hindi language, <code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span>H, xnH<span class="p">}}</span></code> produces ०६, 06. </td></tr> <tr> <td style="text-align: center;"><code>xN</code> </td> <td colspan="2">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string. </td></tr> <tr> <td style="text-align: center;"><code>xr</code> </td> <td>Format the next number as a roman numeral. Only works for numbers up to 10,000<br/><small>(up to 3,000 in pre MediaWiki 1.20)</small>. </td> <td><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span>xrY<span class="p">}}</span></code> → MMXXIV </td></tr> <tr> <td style="text-align: center;"><code>xh</code> </td> <td>Format the next number as a Hebrew numeral. </td> <td><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span>xhY<span class="p">}}</span></code> → ב'כ"ד </td></tr></tbody></table> <p>This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the <a href="/wiki/Special:MyLanguage/Help:Magic_words#Date_and_time" title="Special:MyLanguage/Help:Magic words">magic word</a> <code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">CURRENTTIMESTAMP</span><span class="p">}}</span></code> – that is, the time the page was last rendered into HTML. </p> <dl><dd><code>{{#time: <i>format string</i> }}</code></dd> <dd><code>{{#time: <i>format string</i> | <i>date/time object</i> }}</code></dd> <dd><code>{{#time: <i>format string</i> | <i>date/time object</i> | <i>language code</i> }}</code></dd> <dd><code>{{#time: <i>format string</i> | <i>date/time object</i> | <i>language code</i> | <i>local</i> }}</code></dd></dl> <p>The list of accepted formatting codes is given in the table to the right. Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes). If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output. There are also two ways to escape characters within the formatting string: </p> <ol><li>A backslash followed by a formatting character is interpreted as a single literal character</li> <li>Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</li></ol> <p>In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </p><p>As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </p><p>Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua). So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead). </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> Y-m-d <span class="p">}}</span></code> → <b>2024-12-03</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> <span class="p">[[</span><span class="nt">Y</span><span class="p">]]</span> m d <span class="p">}}</span></code> → <b><a href="/w/index.php?title=2024&action=edit&redlink=1" class="new" title="2024 (page does not exist)">2024</a> 12 03</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> <span class="p">[[</span><span class="nt">Y (year)</span><span class="p">]]</span> <span class="p">}}</span></code> → <b><a href="/w/index.php?title=2024_(24UTCamTue,_03_Dec_2024_01:33:40_%2B0000)&action=edit&redlink=1" class="new" title="2024 (24UTCamTue, 03 Dec 2024 01:33:40 +0000) (page does not exist)">2024 (24UTCamTue, 03 Dec 2024 01:33:40 +0000)</a></b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> <span class="p">[[</span><span class="nt">Y "(year)"</span><span class="p">]]</span> <span class="p">}}</span></code> → <b><a href="/w/index.php?title=2024_(year)&action=edit&redlink=1" class="new" title="2024 (year) (page does not exist)">2024 (year)</a></b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> i's" <span class="p">}}</span></code> → <b>33'40"</b></dd></dl> <p>The <code><i>date/time object</i></code> can be in any format accepted by PHP's <a rel="nofollow" class="external text" href="https://php.net/function.strtotime">strtotime()</a> function. Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted. </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> r<span class="p">|</span>now<span class="p">}}</span></code> → <b>Tue, 03 Dec 2024 01:33:41 +0000</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> r<span class="p">|</span>+2 hours<span class="p">}}</span></code> → <b>Tue, 03 Dec 2024 03:33:41 +0000</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> r<span class="p">|</span>now + 2 hours<span class="p">}}</span></code> → <b>Tue, 03 Dec 2024 03:33:41 +0000</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> r<span class="p">|</span>20 December 2000<span class="p">}}</span></code> → <b>Wed, 20 Dec 2000 00:00:00 +0000</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> r<span class="p">|</span>December 20, 2000<span class="p">}}</span></code> → <b>Wed, 20 Dec 2000 00:00:00 +0000</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> r<span class="p">|</span>2000-12-20<span class="p">}}</span></code> → <b>Wed, 20 Dec 2000 00:00:00 +0000</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> r<span class="p">|</span>2000 December 20<span class="p">}}</span></code> → <b><strong class="error">Error: Invalid time.</strong></b></dd></dl> <p>The <code><i>language code</i></code> in <a href="https://en.wikipedia.org/wiki/ISO_639-3" class="extiw" title="w:ISO 639-3">ISO 639-3</a> (?) allows the string to be displayed in the chosen language </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span>d F Y<span class="p">|</span>1988-02-28<span class="p">|</span>nl<span class="p">}}</span></code> → <b>28 februari 1988</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span>l<span class="p">|</span>now<span class="p">|</span>uk<span class="p">}}</span></code> → <b>вівторок</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span>d xg Y<span class="p">|</span>20 June 2010<span class="p">|</span>pl<span class="p">}}</span></code> → <b>20 czerwca 2010</b></dd></dl> <p>The <code><i>local</i></code> parameter specifies if the <i>date/time object</i> refers to the local timezone or to UTC. </p><p>This is a boolean parameters: its value is determined by casting the value of the argument (see the <a rel="nofollow" class="external text" href="https://php.net/language.types.boolean#language.types.boolean.casting">official PHP documentation</a> for details on how string are cast to boolean values). </p> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r6651107"><div role="note" class="note note-reminder">Please note that, if the variable <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="nv">$wgLocaltimezone</span></code> is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</div> <p>See the following examples for details: </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> Y F d H:i:s<span class="p">|</span>now<span class="p">|</span>it<span class="p">|</span>0<span class="p">}}</span></code> → <b>2024 dicembre 03 01:33:41</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> Y F d H:i:s<span class="p">|</span>now<span class="p">|</span>it<span class="p">|</span>1<span class="p">}}</span></code> → <b>2024 dicembre 03 01:33:41</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> Y F d H:i:s<span class="p">|</span>+2 hours<span class="p">||</span>0<span class="p">}}</span></code> → <b>2024 December 03 03:33:41</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> Y F d H:i:s<span class="p">|</span>+2 hours<span class="p">||</span>1<span class="p">}}</span></code> → <b>2024 December 03 03:33:41</b></dd></dl> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span>c<span class="p">|</span>2019-05-16T17:05:43+02:00<span class="p">|</span>it<span class="p">}}</span></code> → <b>2019-05-16T15:05:43+00:00</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span>c<span class="p">|</span>2019-05-16T17:05:43+02:00<span class="p">|</span>it<span class="p">|</span>0<span class="p">}}</span></code> → <b>2019-05-16T15:05:43+00:00</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span>c<span class="p">|</span>2019-05-16T17:05:43+02:00<span class="p">|</span>it<span class="p">|</span>true<span class="p">}}</span></code> → <b>2019-05-16T15:05:43+00:00</b></dd></dl> <p>If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> U <span class="p">|</span> now <span class="p">}}</span></code> → <b>1733189621</b></dd> <dd><code>{{#time: r | @1733189620 }}</code> → <b>Tue, 03 Dec 2024 01:33:40 +0000</b></dd></dl> <table class="warning-message" style="background-color: var( --background-color-error-subtle, #ffe9e5 ); color: var( --color-base, #202122 ); border: 1px var( --border-color-error, #9f3526 ) solid; box-sizing: border-box; margin: 0.5em 0; padding: 0.5em;"><tbody><tr><td style="white-space: nowrap; vertical-align: top;"><span style="position: relative; top: -2px;"><span typeof="mw:File"><span><img alt="Warning" src="//upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/18px-OOjs_UI_icon_notice-destructive.svg.png" decoding="async" width="18" height="18" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/27px-OOjs_UI_icon_notice-destructive.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/36px-OOjs_UI_icon_notice-destructive.svg.png 2x" data-file-width="20" data-file-height="20"/></span></span></span> <b>Warning:</b> </td><td style="padding-left: 0.5em vertical-align: top;">Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> r <span class="p">|</span> 1970-01-01 00:16:39 <span class="p">}}</span></code> → <b>Thu, 01 Jan 1970 00:16:39 +0000</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> U <span class="p">|</span> 1970-01-01 00:16:39 <span class="p">}}</span></code> → <b>999</b></dd> <dd><code>{{#time: r | @999 }}</code> → <b>Thu, 01 Jan 1970 00:16:39 +0000</b> (correct)</dd> <dd><code>{{#time: r | 999 }}</code> → <b><strong class="error">Error: Invalid time.</strong></b> (unsupported year format)</dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> r <span class="p">|</span> 1970-01-01 00:16:40 <span class="p">}}</span></code> → <b>Thu, 01 Jan 1970 00:16:40 +0000</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> U <span class="p">|</span> 1970-01-01 00:16:40 <span class="p">}}</span></code> → <b>1000</b></dd> <dd><code>{{#time: r | @1000 }}</code> → <b>Thu, 01 Jan 1970 00:16:40 +0000</b> (correct)</dd> <dd><code>{{#time: r | 1000 }}</code> → <b>Wed, 03 Dec 1000 00:00:00 +0000</b> (interpreted as a year with current month and day of the month)</dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> r <span class="p">|</span> 1970-01-01 02:46:39 <span class="p">}}</span></code> → <b>Thu, 01 Jan 1970 02:46:39 +0000</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> U <span class="p">|</span> 1970-01-01 02:46:39 <span class="p">}}</span></code> → <b>9999</b></dd> <dd><code>{{#time: r | @9999 }}</code> → <b>Thu, 01 Jan 1970 02:46:39 +0000</b> (correct)</dd> <dd><code>{{#time: r | 9999 }}</code> → <b>Fri, 03 Dec 9999 00:00:00 +0000</b> (interpreted as a year with current month and day of the month)</dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> r <span class="p">|</span> 1970-01-01 02:46:40 <span class="p">}}</span></code> → <b>Thu, 01 Jan 1970 02:46:40 +0000</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> U <span class="p">|</span> 1970-01-01 02:46:40 <span class="p">}}</span></code> → <b>10000</b></dd> <dd><code>{{#time: r | @10000 }}</code> → <b>Thu, 01 Jan 1970 02:46:40 +0000</b> (correct)</dd> <dd><code>{{#time: r | 10000 }}</code> → <b><strong class="error">Error: Invalid time.</strong></b> (unsupported year format)</dd></dl></td></tr></tbody></table> <table class="warning-message" style="background-color: var( --background-color-error-subtle, #ffe9e5 ); color: var( --color-base, #202122 ); border: 1px var( --border-color-error, #9f3526 ) solid; box-sizing: border-box; margin: 0.5em 0; padding: 0.5em;"><tbody><tr><td style="white-space: nowrap; vertical-align: top;"><span style="position: relative; top: -2px;"><span typeof="mw:File"><span><img alt="Warning" src="//upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/18px-OOjs_UI_icon_notice-destructive.svg.png" decoding="async" width="18" height="18" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/27px-OOjs_UI_icon_notice-destructive.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/36px-OOjs_UI_icon_notice-destructive.svg.png 2x" data-file-width="20" data-file-height="20"/></span></span></span> <b>Warning:</b> </td><td style="padding-left: 0.5em vertical-align: top;">The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> d F Y <span class="p">|</span> 29 Feb 0100 <span class="p">}}</span></code> → <b>01 March 0100</b><br/> (correct, no leap year), but</dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> r <span class="p">|</span> 29 Feb 0100 <span class="p">}}</span></code> → <b>Mon, 01 Mar 0100 00:00:00 +0000</b> (wrong, even if 100 is interpreted as 2000, because that is a leap year)</dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> d F Y <span class="p">|</span> 15 April 10000 <span class="p">}}</span></code> → <b><strong class="error">Error: Invalid time.</strong></b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> r <span class="p">|</span> 10000-4-15 <span class="p">}}</span></code> → <b>Sat, 15 Apr 2000 10:00:00 +0000</b></dd></dl> <p>Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> d F Y <span class="p">|</span> 1 Jan 6 <span class="p">}}</span></code> → <b>01 January 2006</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> d F Y <span class="p">|</span> 1 Jan 06 <span class="p">}}</span></code> → <b>01 January 2006</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> d F Y <span class="p">|</span> 1 Jan 006 <span class="p">}}</span></code> → <b>01 January 2006</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> d F Y <span class="p">|</span> 1 Jan 0006 <span class="p">}}</span></code> → <b>01 January 0006</b> (4-digit format)</dd></dl> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years.</td></tr></tbody></table> <p>Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the <i>current</i> values: </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> Y <span class="p">|</span> January 1 <span class="p">}}</span></code> → <b>2024</b></dd></dl> <table class="warning-message" style="background-color: var( --background-color-error-subtle, #ffe9e5 ); color: var( --color-base, #202122 ); border: 1px var( --border-color-error, #9f3526 ) solid; box-sizing: border-box; margin: 0.5em 0; padding: 0.5em;"><tbody><tr><td style="white-space: nowrap; vertical-align: top;"><span style="position: relative; top: -2px;"><span typeof="mw:File"><span><img alt="Warning" src="//upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/18px-OOjs_UI_icon_notice-destructive.svg.png" decoding="async" width="18" height="18" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/27px-OOjs_UI_icon_notice-destructive.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/36px-OOjs_UI_icon_notice-destructive.svg.png 2x" data-file-width="20" data-file-height="20"/></span></span></span> <b>Warning:</b> </td><td style="padding-left: 0.5em vertical-align: top;">The fill-in feature is not consistent; some parts are filled in using the current values, others are not: <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> Y m d H:i:s <span class="p">|</span> June <span class="p">}}</span></code> → <b>2024 06 03 00:00:00</b> Gives the start of the day, but the current day of the month and the current year.</dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> Y m d H:i:s <span class="p">|</span> 2003 <span class="p">}}</span></code> → <b>2003 12 03 00:00:00</b> Gives the start of the day, but the current day of the year.</dd></dl> <p>There's exception case of the filled day: </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> Y m d H:i:s <span class="p">|</span> June 2003 <span class="p">}}</span></code> → <b>2003 06 01 00:00:00</b> Gives the start of the day and the start of the month.</dd></dl></td></tr></tbody></table> <p>A four-digit number is always interpreted as a year, never as hours and minutes:<sup id="cite_ref-4" class="reference"><a href="#cite_note-4"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> Y m d H:i:s <span class="p">|</span> 1959 <span class="p">}}</span></code> → <b>1959 12 03 00:00:00</b></dd></dl> <p>A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> Y m d H:i:s <span class="p">|</span> 195909 <span class="p">}}</span></code> → <b>2024 12 03 19:59:09</b> Input is treated as a time rather than a year+month code.</dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> Y m d H:i:s <span class="p">|</span> 196009 <span class="p">}}</span></code> → <b><strong class="error">Error: Invalid time.</strong></b> Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</dd></dl> <p>The function performs a certain amount of date mathematics: </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> d F Y <span class="p">|</span> January 0 2008 <span class="p">}}</span></code> → <b>31 December 2007</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> d F <span class="p">|</span> January 32 <span class="p">}}</span></code> → <b><strong class="error">Error: Invalid time.</strong></b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> d F <span class="p">|</span> February 29 2008 <span class="p">}}</span></code> → <b>29 February</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> d F <span class="p">|</span> February 29 2007 <span class="p">}}</span></code> → <b>01 March</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span>Y-F<span class="p">|</span>now -1 months<span class="p">}}</span></code> → <b>2024-November</b></dd></dl> <p>The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters<sup id="cite_ref-5" class="reference"><a href="#cite_note-5"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup>. </p> <div class="mw-heading mw-heading4"><h4 id="Time_Zone_issue" data-mw-thread-id="h-Time_Zone_issue-#time"><span data-mw-comment-start="" id="h-Time_Zone_issue-#time"></span>Time Zone issue<span data-mw-comment-end="h-Time_Zone_issue-#time"></span></h4></div> <p>There is a bug in this #time parser function (more specifically in <i>PHP DateTime</i>) that does not allow the passing-in of <i>non-integers</i> as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </p> <ul><li><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span>g:i A <span class="p">|</span> -4 hours <span class="p">}}</span></code> → 9:33 PM</li></ul> <p>However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </p> <ul><li><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span>g:i A <span class="p">|</span> +5.5 hours <span class="p">}}</span></code> → 1:33 AM</li></ul> <p>To workaround this issue, simply convert the time into minutes or seconds, like this: </p> <ul><li><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span>g:i A <span class="p">|</span> +330 minutes <span class="p">}}</span></code> → 7:03 AM</li> <li><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span>g:i A <span class="p">|</span> +19800 seconds <span class="p">}}</span></code> → 7:03 AM</li></ul> <p>(Tim Starling, the developer of this function, provided the exact syntax for this solution.) </p> <div class="mw-heading mw-heading4"><h4 id="#time_format_like_in_signatures" data-mw-thread-id="h-#time_format_like_in_signatures-#time"><span id=".23time_format_like_in_signatures"></span><span data-mw-comment-start="" id="h-#time_format_like_in_signatures-#time"></span>#time format like in signatures<span data-mw-comment-end="h-#time_format_like_in_signatures-#time"></span></h4></div> <p>Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by <a href="/wiki/Special:MyLanguage/Help:Signatures" title="Special:MyLanguage/Help:Signatures">signatures</a> in discussions on talk pages. On an English-language wiki, it can be created with: </p> <ul><li><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#timel</span><span class="p">:</span>H:i, j xg Y (e)<span class="p">|</span>+330 minutes<span class="p">}}</span></code> → 07:03, 3 December 2024 (UTC)</li></ul> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="#timel" data-mw-thread-id="h-#timel"><span id=".23timel"></span><span data-mw-comment-start="" id="h-#timel"></span>#timel<span data-mw-comment-end="h-#timel"></span></h2><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-#timel","replies":[]}}--></div> <p>This function is a syntactic shortcut that operates identically to <code>{{#time: ... }}</code> with the <code>local</code> parameter set to <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="k">true</span></code>, so it always uses the preferred time zone of the user or the configured time zone of the wiki (as set in <a href="/wiki/Special:MyLanguage/Manual:$wgLocaltimezone" title="Special:MyLanguage/Manual:$wgLocaltimezone">$wgLocaltimezone</a><span style="display:none"><a href="/wiki/Manual:$wgLocaltimezone" title="Manual:$wgLocaltimezone"> </a></span>) </p><p>Syntax of the function is: </p> <dl><dd><code>{{#timel: <i>format string</i> }}</code></dd> <dd><code>{{#timel: <i>format string</i> | <i>date/time object</i> }}</code></dd> <dd><code>{{#timel: <i>format string</i> | <i>date/time object</i> | <i>language code</i> }}</code></dd></dl> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r6651107"><div role="note" class="note note-reminder">Please note that, if the variable <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="nv">$wgLocaltimezone</span></code> is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="k">true</span></code> or <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="k">false</span></code></div> <figure class="mw-default-size" typeof="mw:File/Thumb"><a href="/wiki/File:Time-Timel.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/a/a6/Time-Timel.png/220px-Time-Timel.png" decoding="async" width="220" height="62" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/a/a6/Time-Timel.png/330px-Time-Timel.png 1.5x, //upload.wikimedia.org/wikipedia/commons/a/a6/Time-Timel.png 2x" data-file-width="399" data-file-height="113"/></a><figcaption>Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</figcaption></figure> <p>For instance, see the following examples: </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span>c<span class="p">|</span>now<span class="p">|</span>it<span class="p">}}</span></code> → <b>2024-12-03T01:33:42+00:00</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span>c<span class="p">|</span>now<span class="p">|</span>it<span class="p">|</span>0<span class="p">}}</span></code> → <b>2024-12-03T01:33:42+00:00</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span>c<span class="p">|</span>now<span class="p">|</span>it<span class="p">|</span>1<span class="p">}}</span></code> → <b>2024-12-03T01:33:42+00:00</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#timel</span><span class="p">:</span>c<span class="p">|</span>now<span class="p">|</span>it<span class="p">}}</span></code> → <b>2024-12-03T01:33:42+00:00</b></dd></dl> <figure class="mw-default-size" typeof="mw:File/Thumb"><a href="/wiki/File:Maldiskusjon_Sommertid%E2%80%93Wikipedia.jpg" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/7/72/Maldiskusjon_Sommertid%E2%80%93Wikipedia.jpg/220px-Maldiskusjon_Sommertid%E2%80%93Wikipedia.jpg" decoding="async" width="220" height="243" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/7/72/Maldiskusjon_Sommertid%E2%80%93Wikipedia.jpg/330px-Maldiskusjon_Sommertid%E2%80%93Wikipedia.jpg 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/7/72/Maldiskusjon_Sommertid%E2%80%93Wikipedia.jpg/440px-Maldiskusjon_Sommertid%E2%80%93Wikipedia.jpg 2x" data-file-width="1314" data-file-height="1454"/></a><figcaption>Warning Example from <a class="external free" href="https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid">https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</a></figcaption></figure> <table class="warning-message" style="background-color: var( --background-color-error-subtle, #ffe9e5 ); color: var( --color-base, #202122 ); border: 1px var( --border-color-error, #9f3526 ) solid; box-sizing: border-box; margin: 0.5em 0; padding: 0.5em;"><tbody><tr><td style="white-space: nowrap; vertical-align: top;"><span style="position: relative; top: -2px;"><span typeof="mw:File"><span><img alt="Warning" src="//upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/18px-OOjs_UI_icon_notice-destructive.svg.png" decoding="async" width="18" height="18" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/27px-OOjs_UI_icon_notice-destructive.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/36px-OOjs_UI_icon_notice-destructive.svg.png 2x" data-file-width="20" data-file-height="20"/></span></span></span> <b>Warning:</b> </td><td style="padding-left: 0.5em vertical-align: top;">Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) <dl><dd><code>U</code> Unix time. Seconds since January 1 1970 00:00:00 GMT.</dd> <dd><code>Z</code> Timezone offset in seconds.</dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> U<span class="p">}}</span></code> → <b>1733189620</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#timel</span><span class="p">:</span> U<span class="p">}}</span></code> → <b>1733189620</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#time</span><span class="p">:</span> Z<span class="p">}}</span></code> → <b>0</b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#timel</span><span class="p">:</span> Z<span class="p">}}</span></code> → <b>0</b></dd></dl></td></tr></tbody></table> <div style="clear: both;"></div> <p><span class="anchor" id="timef"></span> </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="#timef" data-mw-thread-id="h-#timef"><span id=".23timef"></span><span data-mw-comment-start="" id="h-#timef"></span>#timef<span data-mw-comment-end="h-#timef"></span></h2><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-#timef","replies":[]}}--></div> <p>This function formats a date using a standard format for the selected language, as defined in <code><a rel="nofollow" class="external text" href="https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages">$dateFormats</a></code> (see <a href="https://phabricator.wikimedia.org/T223772" class="extiw" title="phabricator:T223772">task T223772</a>). </p> <dl><dd><code>{{#timef: <i>date/time object</i> }}</code></dd> <dd><code>{{#timef: <i>date/time object</i> | <i>format type</i> }}</code></dd> <dd><code>{{#timef: <i>date/time object</i> | <i>format type</i> | <i>language code</i> }}</code></dd></dl> <p>The format of the <i>date/time object</i> is the same as for <a href="#time">#time</a>. If it is empty, the time when the page was rendered is used. </p><p>The <i>format type</i> may be one of: </p> <dl><dt><code>time</code></dt> <dd>Only the time is shown.</dd> <dt><code>date</code></dt> <dd>Only the date is shown.</dd> <dt><code>both</code></dt> <dd>Both the time and date are shown.</dd> <dt><code>pretty</code></dt> <dd>Only the date is shown, using an abbreviated format which does not include the year. Not all languages support this; if it is not supported, the "date" format is used.</dd></dl> <p>If the <i>format type</i> is not specified, both the time and date will be show, as if <code>both</code> were specified. </p><p>If the <i>language code</i> is not specified, the page's content language is used. </p><p>Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </p><p>In English, the order of the day and month is controlled by <code><a href="/wiki/Special:MyLanguage/Manual:$wgAmericanDates" title="Special:MyLanguage/Manual:$wgAmericanDates">$wgAmericanDates</a><span style="display:none"><a href="/wiki/Manual:$wgAmericanDates" title="Manual:$wgAmericanDates"> </a></span></code>. </p><p>Examples: </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#timef</span><span class="p">:</span>now<span class="p">|</span>both<span class="p">|</span>en<span class="p">}}</span></code> → <b> 01:33, 3 December 2024 </b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#timef</span><span class="p">:</span>now<span class="p">|</span>both<span class="p">|</span>ja<span class="p">}}</span></code> → <b> 2024年12月3日 (火) 01:33 </b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#timef</span><span class="p">:</span>now<span class="p">|</span>pretty<span class="p">|</span>en<span class="p">}}</span></code> → <b> 3 December </b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#timef</span><span class="p">:</span>now<span class="p">|</span>pretty<span class="p">|</span>pl<span class="p">}}</span></code> → <b> 3 grudnia </b></dd> <dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><span class="p">{{</span><span class="nf">#timef</span><span class="p">:|</span>time<span class="p">}}</span></code> → <b> 01:33 </b></dd></dl> <p><span class="anchor" id="timefl"></span> </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="#timefl" data-mw-thread-id="h-#timefl"><span id=".23timefl"></span><span data-mw-comment-start="" id="h-#timefl"></span>#timefl<span data-mw-comment-end="h-#timefl"></span></h2><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-#timefl","replies":[]}}--></div> <p>This function is the same as <a href="#timef">#timef</a> except that it uses the local timezone of the wiki as configured in <a href="/wiki/Special:MyLanguage/Manual:$wgLocaltimezone" title="Special:MyLanguage/Manual:$wgLocaltimezone">$wgLocaltimezone</a><span style="display:none"><a href="/wiki/Manual:$wgLocaltimezone" title="Manual:$wgLocaltimezone"> </a></span>. </p> <dl><dd><code>{{#timefl: <i>date/time object</i> }}</code></dd> <dd><code>{{#timefl: <i>date/time object</i> | <i>format type</i> }}</code></dd> <dd><code>{{#timefl: <i>date/time object</i> | <i>format type</i> | <i>language code</i> }}</code></dd></dl> <p><span class="anchor" id="titleparts"></span> </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="#titleparts" data-mw-thread-id="h-#titleparts"><span id=".23titleparts"></span><span data-mw-comment-start="" id="h-#titleparts"></span>#titleparts<span data-mw-comment-end="h-#titleparts"></span></h2><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-#titleparts","replies":[]}}--></div> <p>This function separates a page title into segments based on slashes, then returns some of those segments as output. </p> <dl><dd><code class="mw-highlight">{{#titleparts: <i>pagename</i> | <i>number of segments to return</i> | <i>segment to start at</i> }}</code></dd></dl> <p>If the <i>number of segments to return</i> parameter is not specified, it defaults to "0", which returns all the segments from the <i>segment to start at</i> to the end (included). If the <i>segment to start at</i> parameter is not specified or is "0", it defaults to "1": </p> <dl><dd><code>{{#titleparts: <span style="color: blue;">Talk:Foo/bar/baz/quok</span> }}</code> → <b>Talk:Foo/bar/baz/quok</b></dd> <dd><code>{{#titleparts: <span style="color: blue;">Talk:Foo</span>/bar/baz/quok | 1 }}</code> → <b>Talk:Foo</b> See also {{<a href="/wiki/Special:MyLanguage/Help:Magic_words#Page_names" title="Special:MyLanguage/Help:Magic words">ROOTPAGENAME</a><span style="display:none"><a href="/wiki/Help:Magic_words#Page_names" title="Help:Magic words"> </a></span>}}.</dd> <dd><code>{{#titleparts: <span style="color: blue;">Talk:Foo/bar</span>/baz/quok | 2 }}</code> → <b>Talk:Foo/bar</b></dd> <dd><code>{{#titleparts: Talk:Foo/<span style="color: blue;">bar/baz</span>/quok | 2 | 2 }}</code> → <b>bar/baz</b></dd> <dd><code>{{#titleparts: Talk:Foo/bar/<span style="color: blue;">baz/quok</span> | 2 | 3 }}</code> → <b>baz/quok</b></dd> <dd><code>{{#titleparts: Talk:Foo/<span style="color: blue;">bar/baz/quok</span> | 3 | 2 }}</code> → <b>bar/baz/quok</b></dd> <dd><code>{{#titleparts: Talk:Foo/<span style="color: blue;">bar/baz/quok</span> | | 2 }}</code> → <b>bar/baz/quok</b></dd> <dd><code>{{#titleparts: Talk:Foo/bar/baz/quok | | 5 }}</code> → <b> </b></dd></dl> <p>Negative values are accepted for both values. Negative values for the <i>number of segments to return</i> parameter effectively 'strips' segments from the end of the string. Negative values for the <i>first segment to return</i> translates to "start with this segment counting from the right": </p> <dl><dd><code>{{#titleparts: <span style="color: blue;">Talk:Foo/bar/baz</span>/quok | -1 }}</code> → <b>Talk:Foo/bar/baz</b> Strips one segment from the end of the string. See also {{<a href="/wiki/Special:MyLanguage/Help:Magic_words#Page_names" title="Special:MyLanguage/Help:Magic words">BASEPAGENAME</a>}}.</dd> <dd><code>{{#titleparts: Talk:Foo/bar/baz/quok | -4 }}</code> → <b> </b> Strips all 4 segments from the end of the string</dd> <dd><code>{{#titleparts: Talk:Foo/bar/baz/quok | -5 }}</code> → <b> </b> Strips 5 segments from the end of the string (more than exist)</dd> <dd><code>{{#titleparts: Talk:Foo/bar/baz/<span style="color: blue;">quok</span> | | -1 }}</code> → <b> quok</b> Returns last segment. See also {{<a href="/wiki/Special:MyLanguage/Help:Magic_words#Page_names" title="Special:MyLanguage/Help:Magic words">SUBPAGENAME</a>}}.</dd> <dd><code>{{#titleparts: Talk:Foo/<span style="color: blue;">bar/baz</span>/quok | -1 | 2 }}</code> → <b> bar/baz</b> Strips one segment from the end of the string, then returns the second segment and beyond</dd> <dd><code>{{#titleparts: Talk:Foo/bar/<span style="color: blue;">baz</span>/quok | -1 | -2 }}</code> → <b> baz</b> Start copying at the second last element; strip one segment from the end of the string</dd></dl> <p>Before processing, the <i>pagename</i> parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </p> <dl><dd>For example, any occurrence of <code>&quot;</code>, <code>&#34;</code>, or <code>&#x22;</code> in <i>pagename</i> will be replaced by <code>"</code>.</dd> <dd>No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</dd></dl> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r6651107"><div role="note" class="note note-reminder">Some magic keywords or parser functions of MediaWiki (such as <code>{{<a href="/wiki/Special:MyLanguage/Help:Magic_words#Page_names" title="Special:MyLanguage/Help:Magic words">PAGENAME</a><span style="display:none"><a href="/wiki/Help:Magic_words#Page_names" title="Help:Magic words"> </a></span>}}</code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: <p>The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code>{{<a href="/wiki/Special:MyLanguage/Help:Magic_words#PAGESINCAT" title="Special:MyLanguage/Help:Magic words">PAGESINCAT:</a><span style="display:none"><a href="/wiki/Help:Magic_words#PAGESINCAT" title="Help:Magic words"> </a></span>}}</code>) but which are still not working properly with HTML-encoded input strings. </p><p>For example, if the current page is <a href="https://commons.wikimedia.org/wiki/Category:C%C3%B4te-d%27Or" class="extiw" title="commons:Category:Côte-d'Or">Category:Côte-d'Or</a>, then: </p> <ul><li><code>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</code>, and <code>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</code> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</li> <li><code>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</code>, and <code>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</code> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</li> <li><code>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</code>, <code>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</code>, or even <code>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</code> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</li> <li><code>{{PAGESINCAT: Côte-d'Or }}</code> will return a non-zero number, if that category contains pages or subcategories, <b>but</b>:</li> <li><code>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</code>, may still <b>unconditionally</b> return 0, just like:</li> <li><code>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</code></li> <li><code>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</code></li></ul> <p>The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </p> <ul><li><code>{{FULLPAGENAME}}</code>, or even <code>{{FULLPAGENAME:Côte-d'Or}}</code> <i>may</i> return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</li> <li><code>{{PAGESINCAT: Côte-d&apos;Or }}</code> <b>unconditionally</b> returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</li></ul> <p>The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </p> <ul><li><code>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</code></li> <li><code>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</code></li> <li><code>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</code>, that all return the actual number of pages in the same category.</li></ul></div> <p>Then the decoded <i>pagename</i> is canonicalized into a standard page title supported by MediaWiki, as much as possible: </p> <ol><li>All underscores are automatically replaced with spaces: <dl><dd><code>{{#titleparts: Talk:Foo/bah_boo|1|2}}</code> → <b>bah boo</b> Not bah_boo, despite the underscore in the original.</dd></dl></li> <li>The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string. The string is also limited to 255 characters, as it is treated as a <a href="/wiki/Special:MyLanguage/Manual:Page_table#Schema_summary" title="Special:MyLanguage/Manual:Page table">page title</a>: <dl><dd><code>{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/<span style="color: blue;">y/z/aa/bb/cc/dd/ee</span> | 1 | 25 }}</code> → <b>y/z/aa/bb/cc/dd/ee</b></dd> <dd>If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</dd> <dd><code>{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/<span style="color: blue;">z</span>/aa/bb/cc/dd/ee| 1 | 25 }} | 1 | 2}}</code> → <b>z</b></dd></dl></li> <li>Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized). <dl><dd><code>{{#titleparts: <span style="color: blue;">talk:a</span>/b/c }}</code> → <b>Talk:A/b/c</b></dd></dl></li></ol> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r6651107"><div role="note" class="note note-reminder">You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: <dl><dd><code>{{#titleparts: <span style="color: blue;">one</span>/two/three/four|1|1 }}</code> → <b>One</b></dd> <dd><code>{{#titleparts: one/<span style="color: blue;">two</span>/three/four|1|2 }}</code> → <b>two</b></dd></dl> <p>If lower case is needed, use lc: function to control output: </p> <dl><dd><code>{{lc: {{#titleparts: <span style="color: blue;">one</span>/two/three/four|1|1 }} }}</code> → <b>one</b></dd></dl> <p>You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for <i>first segment to return</i>: </p> <dl><dd><code>{{#titleparts: <b>/</b><span style="color: blue;">one</span>/two/three/four|1|<b><u>2</u></b> }}</code> → <b>one</b></dd> <dd><code>{{#titleparts: <b>/</b><span style="color: blue;">One</span>/two/three/four|1|<b><u>2</u></b> }}</code> → <b>One</b></dd></dl></div> <table class="warning-message" style="background-color: var( --background-color-error-subtle, #ffe9e5 ); color: var( --color-base, #202122 ); border: 1px var( --border-color-error, #9f3526 ) solid; box-sizing: border-box; margin: 0.5em 0; padding: 0.5em;"><tbody><tr><td style="white-space: nowrap; vertical-align: top;"><span style="position: relative; top: -2px;"><span typeof="mw:File"><span><img alt="Warning" src="//upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/18px-OOjs_UI_icon_notice-destructive.svg.png" decoding="async" width="18" height="18" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/27px-OOjs_UI_icon_notice-destructive.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/36px-OOjs_UI_icon_notice-destructive.svg.png 2x" data-file-width="20" data-file-height="20"/></span></span></span> <b>Warning:</b> </td><td style="padding-left: 0.5em vertical-align: top;">Certain characters that are illegal in a page title will cause #titleparts to not parse the string: <dl><dd><code>{{#titleparts: {one/two} | 1 | 1 }}</code> → <b>{one/two}</b>. Does not produce the expected: <b>{one</b></dd> <dd><code>{{#titleparts: [[page]]/123 | 1 | 2 }}</code> → <b><a href="/w/index.php?title=Page&action=edit&redlink=1" class="new" title="Page (page does not exist)">page</a>/123</b>. Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input <i>pagename</i> parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</dd> <dd><code>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</code> → "". Does not work because "#" is also illegal in page titles.</dd></dl></td></tr></tbody></table> <table class="warning-message" style="background-color: var( --background-color-error-subtle, #ffe9e5 ); color: var( --color-base, #202122 ); border: 1px var( --border-color-error, #9f3526 ) solid; box-sizing: border-box; margin: 0.5em 0; padding: 0.5em;"><tbody><tr><td style="white-space: nowrap; vertical-align: top;"><span style="position: relative; top: -2px;"><span typeof="mw:File"><span><img alt="Warning" src="//upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/18px-OOjs_UI_icon_notice-destructive.svg.png" decoding="async" width="18" height="18" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/27px-OOjs_UI_icon_notice-destructive.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/36px-OOjs_UI_icon_notice-destructive.svg.png 2x" data-file-width="20" data-file-height="20"/></span></span></span> <b>Warning:</b> </td><td style="padding-left: 0.5em vertical-align: top;">If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: <dl><dd><code>{{#titleparts: one/./three | 1 | 1 }}</code> → <b>one/./three</b>. The whole string is returned. It does not produce the expected: <b>one</b></dd></dl></td></tr></tbody></table> <table class="warning-message" style="background-color: var( --background-color-error-subtle, #ffe9e5 ); color: var( --color-base, #202122 ); border: 1px var( --border-color-error, #9f3526 ) solid; box-sizing: border-box; margin: 0.5em 0; padding: 0.5em;"><tbody><tr><td style="white-space: nowrap; vertical-align: top;"><span style="position: relative; top: -2px;"><span typeof="mw:File"><span><img alt="Warning" src="//upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/18px-OOjs_UI_icon_notice-destructive.svg.png" decoding="async" width="18" height="18" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/27px-OOjs_UI_icon_notice-destructive.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/36px-OOjs_UI_icon_notice-destructive.svg.png 2x" data-file-width="20" data-file-height="20"/></span></span></span> <b>Warning:</b> </td><td style="padding-left: 0.5em vertical-align: top;">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</td></tr></tbody></table> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="String_functions" data-mw-thread-id="h-String_functions"><span data-mw-comment-start="" id="h-String_functions"></span>String functions<span data-mw-comment-end="h-String_functions"></span></h2><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-String_functions","replies":[]}}--></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r6353907"><div role="note" class="hatnote relarticle mainarticle">Main page: <a href="/wiki/Special:MyLanguage/Extension:ParserFunctions/String_functions" title="Special:MyLanguage/Extension:ParserFunctions/String functions">Extension:ParserFunctions/String functions</a><span style="display:none"><a href="/wiki/Extension:ParserFunctions/String_functions" title="Extension:ParserFunctions/String functions"> </a></span></div> <p>The ParserFunctions extension optionally defines various string functions if <code>$wgPFEnableStringFunctions </code> is set to <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="k">true</span></code>: </p> <ul><li><code>#len</code></li> <li><code>#pos</code></li> <li><code>#rpos</code></li> <li><code>#sub</code></li> <li><code>#count</code></li> <li><code>#replace</code></li> <li><code>#explode</code></li> <li><code>#urldecode</code></li></ul> <p>See the dedicated subpage for documentation, and <a href="/wiki/Special:MyLanguage/Manual:Performing_string_operations_with_parser_functions" title="Special:MyLanguage/Manual:Performing string operations with parser functions">Manual:Performing string operations with parser functions</a><span style="display:none"><a href="/wiki/Manual:Performing_string_operations_with_parser_functions" title="Manual:Performing string operations with parser functions"> </a></span> for examples. </p> <table class="warning-message" style="background-color: var( --background-color-error-subtle, #ffe9e5 ); color: var( --color-base, #202122 ); border: 1px var( --border-color-error, #9f3526 ) solid; box-sizing: border-box; margin: 0.5em 0; padding: 0.5em;"><tbody><tr><td style="white-space: nowrap; vertical-align: top;"><span style="position: relative; top: -2px;"><span typeof="mw:File"><span><img alt="Warning" src="//upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/18px-OOjs_UI_icon_notice-destructive.svg.png" decoding="async" width="18" height="18" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/27px-OOjs_UI_icon_notice-destructive.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/36px-OOjs_UI_icon_notice-destructive.svg.png 2x" data-file-width="20" data-file-height="20"/></span></span></span> <b>Warning:</b> </td><td style="padding-left: 0.5em vertical-align: top;">In 2013, it was decided that <b>these functions will <i>never</i> be enabled on any Wikimedia wiki</b>, because they are inefficient when used on a large scale (see <a href="https://phabricator.wikimedia.org/T8455" class="extiw" title="phab:T8455">phab:T8455</a> for some history). <b>These functions do NOT work on Wikimedia wikis!</b><br/><br/>If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses <a href="/wiki/Special:MyLanguage/Extension:Scribunto" title="Special:MyLanguage/Extension:Scribunto">Lua</a><span style="display:none"><a href="/wiki/Extension:Scribunto" title="Extension:Scribunto"> </a></span>. For example, the English Wikipedia uses <a href="https://en.wikipedia.org/wiki/Module:String" class="extiw" title="w:Module:String">Module:String</a>, which does some of the same things with wildly different syntax. There are also individual <a href="https://en.wikipedia.org/wiki/Template:String-handling_templates" class="extiw" title="w:Template:String-handling templates">String-handling templates</a>.</td></tr></tbody></table> <p>Here is a short overview of <a href="/wiki/Module:String" title="Module:String">Module:String</a> functions: </p> <ul><li><a href="https://en.wikipedia.org/wiki/Module:String#len" class="extiw" title="w:Module:String">#len</a> (length of string): <code>{{<a href="https://en.wikipedia.org/wiki/Wikipedia:Lua" class="extiw" title="w:Wikipedia:Lua">#invoke</a>:String|len|target_string}}</code></li> <li><a href="https://en.wikipedia.org/wiki/Module:String#sub" class="extiw" title="w:Module:String">#sub</a> (substring): <code>{{#invoke:String|sub|target_string|start_index|end_index}}</code></li> <li><a href="https://en.wikipedia.org/wiki/Module:String#match" class="extiw" title="w:Module:String">#match</a>: <code>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</code></li> <li><a href="https://en.wikipedia.org/wiki/Module:String#pos" class="extiw" title="w:Module:String">#pos</a> (position of target): <code>{{#invoke:String|pos|target_string|index_value}}</code></li> <li><a href="https://en.wikipedia.org/wiki/Module:String#find" class="extiw" title="w:Module:String">#find</a>: <code>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</code></li> <li><a href="https://en.wikipedia.org/wiki/Module:String#replace_(gsub)" class="extiw" title="w:Module:String">#replace</a>: <code>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</code></li> <li><a href="https://en.wikipedia.org/wiki/Module:String#rep" class="extiw" title="w:Module:String">#rep</a> (repeat): <code>{{#invoke:String|rep|source|count}}</code></li> <li><a href="https://en.wikipedia.org/wiki/Module:String#escapePattern" class="extiw" title="w:Module:String">#escapePattern</a>: <code>{{#invoke:String|escapePattern|pattern_string}}</code></li> <li><a href="https://en.wikipedia.org/wiki/Module:String#count" class="extiw" title="w:Module:String">#count</a>: <code>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</code></li> <li><a href="https://en.wikipedia.org/wiki/Module:String#join" class="extiw" title="w:Module:String">#join</a>: <code>{{#invoke:String|join|separator|string1|string2|...}}</code></li></ul> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="General_points" data-mw-thread-id="h-General_points"><span data-mw-comment-start="" id="h-General_points"></span>General points<span data-mw-comment-end="h-General_points"></span></h2><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-General_points","replies":["h-Substitution-General_points","h-Redirects-General_points","h-Escaping_pipe_characters_in_tables-General_points","h-Stripping_whitespace-General_points"]}}--></div> <div class="mw-heading mw-heading3"><h3 id="Substitution" data-mw-thread-id="h-Substitution-General_points"><span data-mw-comment-start="" id="h-Substitution-General_points"></span>Substitution<span data-mw-comment-end="h-Substitution-General_points"></span></h3></div> <p>Parser functions can be <a href="/wiki/Special:MyLanguage/Help:Substitution" title="Special:MyLanguage/Help:Substitution">substituted</a> by prefixing the hash character with <code><b>subst:</b></code>: </p> <dl><dd><code>{{subst:#ifexist: Help:Extension:ParserFunctions | [[Help:Extension:ParserFunctions]] | Help:Extension:ParserFunctions }}</code> → the code <b><code>[[Help:Extension:ParserFunctions]]</code></b> will be inserted in the wikitext since the page Help:Extension:ParserFunctions exists.</dd></dl> <table class="warning-message" style="background-color: var( --background-color-error-subtle, #ffe9e5 ); color: var( --color-base, #202122 ); border: 1px var( --border-color-error, #9f3526 ) solid; box-sizing: border-box; margin: 0.5em 0; padding: 0.5em;"><tbody><tr><td style="white-space: nowrap; vertical-align: top;"><span style="position: relative; top: -2px;"><span typeof="mw:File"><span><img alt="Warning" src="//upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/18px-OOjs_UI_icon_notice-destructive.svg.png" decoding="async" width="18" height="18" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/27px-OOjs_UI_icon_notice-destructive.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/36px-OOjs_UI_icon_notice-destructive.svg.png 2x" data-file-width="20" data-file-height="20"/></span></span></span> <b>Warning:</b> </td><td style="padding-left: 0.5em vertical-align: top;">The results of substituted parser functions are undefined if the expressions contain <i>un</i>substituted volatile code such as <a href="/wiki/Special:MyLanguage/Help:Magic_words#Variables" title="Special:MyLanguage/Help:Magic words">variables</a><span style="display:none"><a href="/wiki/Help:Magic_words#Variables" title="Help:Magic words"> </a></span> or other parser functions. For consistent results, all the volatile code in the expression to be evaluated must be substituted. See <a href="https://en.wikipedia.org/wiki/Help:Substitution" class="extiw" title="w:Help:Substitution">Help:Substitution</a>.</td></tr></tbody></table> <p>Substitution does not work within <a href="/wiki/Special:MyLanguage/Extension:Cite#Substitution_and_embedded_parser_functions" title="Special:MyLanguage/Extension:Cite"><style data-mw-deduplicate="TemplateStyles:r4673781">.mw-parser-output .nowrap,.mw-parser-output .nowrap a:before,.mw-parser-output .nowrap .selflink:before{white-space:nowrap}</style><code class="mw-highlight nowrap"><span class="p"><</span><span class="nt">ref</span><span class="p">></span></code>…<link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r4673781"><code class="mw-highlight nowrap"><span class="p"></</span><span class="nt">ref</span><span class="p">></span></code></a><span style="display:none"><a href="/wiki/Extension:Cite#Substitution_and_embedded_parser_functions" title="Extension:Cite"> </a></span>; you can use <code>{{subst:#tag:ref|</code>…<code>}}</code> for this purpose. </p> <div class="mw-heading mw-heading3"><h3 id="Redirects" data-mw-thread-id="h-Redirects-General_points"><span data-mw-comment-start="" id="h-Redirects-General_points"></span>Redirects<span data-mw-comment-end="h-Redirects-General_points"></span></h3></div> <p>Especially <a href="#.23time">{{<code>#time:</code>…|<code>now-</code>…}}</a> could be handy in <a href="/wiki/Special:MyLanguage/Help:Redirects" title="Special:MyLanguage/Help:Redirects">redirects</a><span style="display:none"><a href="/wiki/Help:Redirects" title="Help:Redirects"> </a></span> to pages including dates, but this does not work. </p> <div class="mw-heading mw-heading3"><h3 id="Escaping_pipe_characters_in_tables" data-mw-thread-id="h-Escaping_pipe_characters_in_tables-General_points"><span data-mw-comment-start="" id="h-Escaping_pipe_characters_in_tables-General_points"></span>Escaping pipe characters in tables<span data-mw-comment-end="h-Escaping_pipe_characters_in_tables-General_points"></span></h3></div> <p>Parser functions will mangle <a href="/wiki/Special:MyLanguage/Help:Tables" title="Special:MyLanguage/Help:Tables">wikitable</a><span style="display:none"><a href="/wiki/Help:Tables" title="Help:Tables"> </a></span> syntax and pipe characters (<code>|</code>), treating all the raw pipe characters as parameter dividers. To avoid this, most wikis used a template <a href="/wiki/Template:!" title="Template:!">Template:!</a> with its contents only a raw pipe character (<code>|</code>), since MW 1.24 a <a href="/wiki/Special:MyLanguage/Help:Magic_words#Other" title="Special:MyLanguage/Help:Magic words"><code>{{!}}</code> magic word</a><span style="display:none"><a href="/wiki/Help:Magic_words#Other" title="Help:Magic words"> </a></span> replaced this kludge. This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded. It will then be interpreted as a table row or column separator. Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone. </p><p>You can also escape the pipe character for display as a plain, uninterpreted character using an HTML entity: <code>&#124;</code> . </p> <table class="wikitable"> <tbody><tr> <th>Description </th> <th>You type </th> <th>You get </th></tr> <tr> <td>Escaping pipe character as table row/column separator </td> <td><pre>{{!}} </pre> </td> <td style="text-align:center;">| </td></tr> <tr> <td>Escaping pipe character as a plain character </td> <td><pre>&#124; </pre> </td> <td style="text-align:center;">| </td></tr></tbody></table> <div class="mw-heading mw-heading3"><h3 id="Stripping_whitespace" data-mw-thread-id="h-Stripping_whitespace-General_points"><span data-mw-comment-start="" id="h-Stripping_whitespace-General_points"></span>Stripping whitespace<span data-mw-comment-end="h-Stripping_whitespace-General_points"></span></h3></div> <p>Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </p> <dl><dd><code>{{#ifeq: foo | foo | equal | not equal }}</code> → <b>equal</b></dd> <dd><code>{{#ifeq: "foo " | " foo" | equal | not equal }}</code> → <b>not equal</b></dd></dl> <p>To prevent the trimming of then and else parts, see <a href="https://meta.wikimedia.org/wiki/Template:If" class="extiw" title="m:Template:If">m:Template:If</a>. Some people achieve this by using <<a href="/wiki/Special:MyLanguage/Wiki_markup#Nowiki" title="Special:MyLanguage/Wiki markup">nowiki</a><span style="display:none"><a href="/wiki/Wiki_markup#Nowiki" class="mw-redirect" title="Wiki markup"> </a></span>> </nowiki> instead of spaces. </p> <dl><dd><code class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr">foo<span class="p">{{</span><span class="nf">#if</span><span class="p">:||</span> bar <span class="p">}}</span>foo</code> → <b>foobarfoo</b></dd> <dd><code class="mw-highlight mw-highlight-lang-xml mw-content-ltr" dir="ltr">foo{{#if:||<span class="nt"><nowiki</span><span class="w"> </span><span class="nt">/></span><span class="w"> </span>bar<span class="w"> </span><span class="nt"><nowiki</span><span class="w"> </span><span class="nt">/></span>}}foo</code> → <b>foo bar foo</b></dd></dl> <p>However, this method can be used to render a <b>single</b> whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </p> <dl><dd><table> <tbody><tr> <td><div class="mw-highlight mw-highlight-lang-html mw-content-ltr" dir="ltr"><pre><span></span><span class="p"><</span><span class="nt">span</span> <span class="na">style</span><span class="o">=</span><span class="s">"white-space: pre;"</span><span class="p">></span>foo{{#if:||<span class="p"><</span><span class="nt">nowiki</span><span class="p">/></span> bar <span class="p"><</span><span class="nt">nowiki</span><span class="p">/></span>}}foo<span class="p"></</span><span class="nt">span</span><span class="p">></span> </pre></div></td> <td>→</td> <td><b><span style="white-space: pre;">foo bar foo</span></b> </td></tr></tbody></table></dd></dl> <p>In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </p><p>It is possible to workaround this behavior replacing whitespaces with <code>&#32;</code> (<i>breakable space</i>) or <code>&nbsp;</code> (<i>non-breakable space</i>), since they are not modified by the software: </p> <dl><dd><code class="mw-highlight mw-highlight-lang-html mw-content-ltr" dir="ltr"><span class="p"><</span><span class="nt">span</span> <span class="na">style</span><span class="o">=</span><span class="s">"white-space: pre;"</span><span class="p">></span>foo{{#if:||<span class="ni">&#32;&#32;&#32;</span>bar<span class="ni">&#32;&#32;&#32;</span>}}foo<span class="p"></</span><span class="nt">span</span><span class="p">></span></code> → <b><span style="white-space: pre;">foo bar foo</span></b></dd> <dd><code class="mw-highlight mw-highlight-lang-html mw-content-ltr" dir="ltr">foo{{#if:||<span class="ni">&nbsp;&nbsp;&nbsp;</span>bar<span class="ni">&nbsp;&nbsp;&nbsp;</span>}}foo</code> → <b>foo bar foo</b></dd></dl> <p>Beware that not all parameters are created equal. In ParserFunctions, whitespace at the beginning and end is always stripped. In <a href="/wiki/Special:MyLanguage/Help:Templates" title="Special:MyLanguage/Help:Templates">templates</a><span style="display:none"><a href="/wiki/Help:Templates" title="Help:Templates"> </a></span>, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but <i>not</i> from unnamed parameters: </p> <dl><dd><code>foo<style data-mw-deduplicate="TemplateStyles:r4719022">.mw-parser-output .monospaced{font-family:monospace,monospace}</style><span class="monospaced">{{<a href="/wiki/Template:1x" title="Template:1x">1x</a>|content= bar}}</span>foo</code> → <b>foobarfoo</b></dd> <dd><code>foo<link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r4719022"><span class="monospaced">{{<a href="/wiki/Template:1x" title="Template:1x">1x</a>|1= bar}}</span>foo</code> → <b>foobarfoo</b></dd> <dd><code>foo<link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r4719022"><span class="monospaced">{{<a href="/wiki/Template:1x" title="Template:1x">1x</a>| bar }}</span>foo</code> → <b>foo bar foo</b></dd></dl> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="Other_parser_functions" data-mw-thread-id="h-Other_parser_functions"><span data-mw-comment-start="" id="h-Other_parser_functions"></span>Other parser functions<span data-mw-comment-end="h-Other_parser_functions"></span></h2><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-Other_parser_functions","replies":["h-Case_conversion_functions-Other_parser_functions","h-Encoding_functions-Other_parser_functions","h-Anchor_encoding-Other_parser_functions","h-Padding_functions-Other_parser_functions","h-Formatting_functions-Other_parser_functions"]}}--></div> <div class="mw-heading mw-heading3"><h3 id="Case_conversion_functions" data-mw-thread-id="h-Case_conversion_functions-Other_parser_functions"><span data-mw-comment-start="" id="h-Case_conversion_functions-Other_parser_functions"></span>Case conversion functions<span data-mw-comment-end="h-Case_conversion_functions-Other_parser_functions"></span></h3></div> <ul><li><b>Lowercase:</b> <code>"{{lc: AbC}}"</code> → "abc" <a class="external autonumber" href="https://www.mediawiki.org/w/index.php?title=Special:ExpandTemplates&wpInput=%22%7B%7Blc%3A+AbC%7D%7D%22&removecomments=true">[1]</a></li> <li><b>Uppercase:</b> <code>"{{uc: AbC}}"</code> → "ABC" <a class="external autonumber" href="https://www.mediawiki.org/w/index.php?title=Special:ExpandTemplates&wpInput=%22%7B%7Buc%3A+AbC%7D%7D%22&removecomments=true">[2]</a></li> <li><b>Lowercase first character:</b> <code>"{{lcfirst: AbC}}"</code> → "abC" <a class="external autonumber" href="https://www.mediawiki.org/w/index.php?title=Special:ExpandTemplates&wpInput=%22%7B%7Blcfirst%3A+AbC%7D%7D%22&removecomments=true">[3]</a></li> <li><b>Uppercase first character:</b> <code>"{{ucfirst: abc}}"</code> → "Abc" <a class="external autonumber" href="https://www.mediawiki.org/w/index.php?title=Special:ExpandTemplates&wpInput=%22%7B%7Bucfirst%3A+abc%7D%7D%22&removecomments=true">[4]</a></li></ul> <div class="mw-heading mw-heading3"><h3 id="Encoding_functions" data-mw-thread-id="h-Encoding_functions-Other_parser_functions"><span data-mw-comment-start="" id="h-Encoding_functions-Other_parser_functions"></span>Encoding functions<span data-mw-comment-end="h-Encoding_functions-Other_parser_functions"></span></h3></div> <ul><li><b>URL encoding:</b></li></ul> <div class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><pre><span></span>"<span class="p">{{</span><span class="nf">urlencode</span><span class="p">:</span> AbC dEf ghi<span class="p">}}</span>" </pre></div> <p>renders as </p> <hr/> <p>"AbC%0AdEf+ghi" </p> <hr/> <p>So inner new lines convert into %0A, and inner spaces convert into +. </p> <div class="mw-heading mw-heading3"><h3 id="Anchor_encoding" data-mw-thread-id="h-Anchor_encoding-Other_parser_functions"><span data-mw-comment-start="" id="h-Anchor_encoding-Other_parser_functions"></span>Anchor encoding<span data-mw-comment-end="h-Anchor_encoding-Other_parser_functions"></span></h3></div> <div class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><pre><span></span><span class="p">{{</span><span class="nf">anchorencode</span><span class="p">:</span> AbC dEf ghi<span class="p">}}</span> </pre></div> <p>renders as </p> <hr/> <p>AbC_dEf_ghi </p> <hr/> <div class="mw-heading mw-heading3"><h3 id="Padding_functions" data-mw-thread-id="h-Padding_functions-Other_parser_functions"><span data-mw-comment-start="" id="h-Padding_functions-Other_parser_functions"></span>Padding functions<span data-mw-comment-end="h-Padding_functions-Other_parser_functions"></span></h3></div> <ul><li><code>"{{padleft: bc d |8|a}}"</code> gives "aaaabc d" <a class="external autonumber" href="https://www.mediawiki.org/w/index.php?title=Special:ExpandTemplates&wpInput=%22%7B%7Bpadleft%3A+bc+d%7c8%7ca%7D%7D%22&removecomments=true">[5]</a></li> <li><code>"{{padright: bc d |8|a}}"</code> gives "bc daaaa" <a class="external autonumber" href="https://www.mediawiki.org/w/index.php?title=Special:ExpandTemplates&wpInput=%22%7B%7Bpadright%3A+bc+d%7c8%7ca%7D%7D%22&removecomments=true">[6]</a></li></ul> <div class="mw-heading mw-heading3"><h3 id="Formatting_functions" data-mw-thread-id="h-Formatting_functions-Other_parser_functions"><span data-mw-comment-start="" id="h-Formatting_functions-Other_parser_functions"></span>Formatting functions<span data-mw-comment-end="h-Formatting_functions-Other_parser_functions"></span></h3></div> <ul><li><code>"{{formatnum: 1234567890}}"</code> gives "1,234,567,890" <a class="external autonumber" href="https://www.mediawiki.org/w/index.php?title=Special:ExpandTemplates&wpInput=%22%7B%7Bformatnum%3A+1234567890%7D%7D%22">[7]</a></li></ul> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="See_also" data-mw-thread-id="h-See_also"><span data-mw-comment-start="" id="h-See_also"></span>See also<span data-mw-comment-end="h-See_also"></span></h2><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-See_also","replies":[]}}--></div> <ul><li><a href="/wiki/Special:MyLanguage/Help:Parser_functions_in_templates" title="Special:MyLanguage/Help:Parser functions in templates">Help:Parser functions in templates</a><span style="display:none"><a href="/wiki/Help:Parser_functions_in_templates" title="Help:Parser functions in templates"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Parser_extension_tags" title="Special:MyLanguage/Parser extension tags">Parser extension tags</a><span style="display:none"><a href="/wiki/Parser_extension_tags" title="Parser extension tags"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Parser_function_hooks" title="Special:MyLanguage/Parser function hooks">Parser function hooks</a><span style="display:none"><a href="/wiki/Parser_function_hooks" title="Parser function hooks"> </a></span> - an (incomplete) list of parser functions added by core and extensions.</li> <li><a href="/wiki/Special:MyLanguage/Manual:Newlines_and_spaces" title="Special:MyLanguage/Manual:Newlines and spaces">Manual:Newlines and spaces</a><span style="display:none"><a href="/wiki/Manual:Newlines_and_spaces" title="Manual:Newlines and spaces"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Manual:Converting_between_ParserFunctions_syntax_and_TeX_syntax" title="Special:MyLanguage/Manual:Converting between ParserFunctions syntax and TeX syntax">Manual:Converting between ParserFunctions syntax and TeX syntax</a><span style="display:none"><a href="/wiki/Manual:Converting_between_ParserFunctions_syntax_and_TeX_syntax" title="Manual:Converting between ParserFunctions syntax and TeX syntax"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Help:Magic_words" title="Special:MyLanguage/Help:Magic words">Help:Magic words</a><span style="display:none"><a href="/wiki/Help:Magic_words" title="Help:Magic words"> </a></span></li> <li><a href="/wiki/Module:String" title="Module:String">Module:String</a> obsoleting <a href="/wiki/Special:MyLanguage/Extension:StringFunctions" title="Special:MyLanguage/Extension:StringFunctions">Extension:StringFunctions</a><span style="display:none"><a href="/wiki/Extension:StringFunctions" class="mw-redirect" title="Extension:StringFunctions"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Extension:PhpTags" title="Special:MyLanguage/Extension:PhpTags">Extension:PhpTags</a><span style="display:none"><a href="/wiki/Extension:PhpTags" title="Extension:PhpTags"> </a></span></li> <li>Parser functions for Wikibase (the extensions that enables Wikidata): <a href="https://www.wikidata.org/wiki/Special:MyLanguage/Wikidata:How_to_use_data_on_Wikimedia_projects#Parser_function" class="extiw" title="d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects">How to use data on Wikimedia projects#Parser function</a></li></ul> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="References" data-mw-thread-id="h-References"><span data-mw-comment-start="" id="h-References"></span>References<span data-mw-comment-end="h-References"></span></h2><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-References","replies":[]}}--></div> <div class="mw-references-wrap"><ol class="references"> <li id="cite_note-4"><span class="mw-cite-backlink"><a href="#cite_ref-4">↑</a></span> <span class="reference-text">Prior to <span class="plainlinks"><a class="external text" href="https://static-codereview.wikimedia.org/MediaWiki/86805.html">r86805</a></span> in 2011 this was not the case.</span> </li> <li id="cite_note-5"><span class="mw-cite-backlink"><a href="#cite_ref-5">↑</a></span> <span class="reference-text"><a class="external text" href="https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31">ParserFunctions.php</a> at phabricator.wikimedia.org</span> </li> </ol></div> <div class="navbox-styles nomobile"><style data-mw-deduplicate="TemplateStyles:r6230902">.mw-parser-output .navbox{border:1px solid #aaa;box-sizing:border-box;width:100%;margin:auto;clear:both;font-size:88%;text-align:center;padding:1px}.mw-parser-output .navbox-inner,.mw-parser-output .navbox-subgroup{width:100%}.mw-parser-output .navbox+.navbox-styles+.navbox{margin-top:-1px}.mw-parser-output .navbox th,.mw-parser-output .navbox-title,.mw-parser-output .navbox-abovebelow{text-align:center;padding-left:1em;padding-right:1em}.mw-parser-output th.navbox-group{white-space:nowrap;text-align:right}.mw-parser-output .navbox,.mw-parser-output .navbox-subgroup{background:#fdfdfd}.mw-parser-output .navbox-list{border-color:#fdfdfd}.mw-parser-output .navbox th,.mw-parser-output .navbox-title{background:#eaeeff}.mw-parser-output .navbox-abovebelow,.mw-parser-output th.navbox-group,.mw-parser-output .navbox-subgroup .navbox-title{background:#ddddff}.mw-parser-output .navbox-subgroup .navbox-group,.mw-parser-output .navbox-subgroup .navbox-abovebelow{background:#e6e6ff}.mw-parser-output .navbox-even{background:#f7f7f7}.mw-parser-output .navbox-odd{background:transparent}.mw-parser-output th.navbox-title1{border-left:2px solid #fdfdfd;width:100%}.mw-parser-output td.navbox-list1{text-align:left;border-left-width:2px;border-left-style:solid}.mw-parser-output .navbox .hlist td dl,.mw-parser-output .navbox .hlist td ol,.mw-parser-output .navbox .hlist td ul,.mw-parser-output .navbox td.hlist dl,.mw-parser-output .navbox td.hlist ol,.mw-parser-output .navbox td.hlist ul{padding:0.125em 0}.mw-parser-output .navbox .hlist dd,.mw-parser-output .navbox .hlist dt,.mw-parser-output .navbox .hlist li{white-space:nowrap}.mw-parser-output .navbox .hlist dd dl,.mw-parser-output .navbox .hlist dt dl,.mw-parser-output .navbox .hlist li ol,.mw-parser-output .navbox .hlist li ul{white-space:normal}.mw-parser-output ol+.navbox-styles+.navbox,.mw-parser-output ul+.navbox-styles+.navbox{margin-top:0.5em}</style></div><div role="navigation" class="navbox" aria-labelledby="Parser_functions" style="padding:3px"><table class="nowraplinks mw-collapsible autocollapse navbox-inner" style="border-spacing:0;background:transparent;color:inherit"><tbody><tr><th scope="col" class="navbox-title" colspan="2"><style data-mw-deduplicate="TemplateStyles:r6387430">.mw-parser-output .hlist dl,.mw-parser-output .hlist ol,.mw-parser-output .hlist ul{margin:0;padding:0}.mw-parser-output .hlist dd,.mw-parser-output .hlist dt,.mw-parser-output .hlist li{margin:0;display:inline}.mw-parser-output .hlist dl dl,.mw-parser-output .hlist dl ol,.mw-parser-output .hlist dl ul,.mw-parser-output .hlist ol dl,.mw-parser-output .hlist ol ol,.mw-parser-output .hlist ol ul,.mw-parser-output .hlist ul dl,.mw-parser-output .hlist ul ol,.mw-parser-output .hlist ul ul{display:inline}.mw-parser-output .hlist .mw-empty-li,.mw-parser-output .hlist .mw-empty-elt{display:none}.mw-parser-output .hlist dt:after{content:": "}.mw-parser-output .hlist dd:after,.mw-parser-output .hlist li:after{content:" · ";font-weight:bold}.mw-parser-output .hlist dd:last-child:after,.mw-parser-output .hlist dt:last-child:after,.mw-parser-output .hlist li:last-child:after{content:none}.mw-parser-output .hlist dd dd:first-child:before,.mw-parser-output .hlist dd dt:first-child:before,.mw-parser-output .hlist dd li:first-child:before,.mw-parser-output .hlist dt dd:first-child:before,.mw-parser-output .hlist dt dt:first-child:before,.mw-parser-output .hlist dt li:first-child:before,.mw-parser-output .hlist li dd:first-child:before,.mw-parser-output .hlist li dt:first-child:before,.mw-parser-output .hlist li li:first-child:before{content:" (";font-weight:normal}.mw-parser-output .hlist dd dd:last-child:after,.mw-parser-output .hlist dd dt:last-child:after,.mw-parser-output .hlist dd li:last-child:after,.mw-parser-output .hlist dt dd:last-child:after,.mw-parser-output .hlist dt dt:last-child:after,.mw-parser-output .hlist dt li:last-child:after,.mw-parser-output .hlist li dd:last-child:after,.mw-parser-output .hlist li dt:last-child:after,.mw-parser-output .hlist li li:last-child:after{content:")";font-weight:normal}.mw-parser-output .hlist ol{counter-reset:listitem}.mw-parser-output .hlist ol>li{counter-increment:listitem}.mw-parser-output .hlist ol>li:before{content:" "counter(listitem)"\a0 "}.mw-parser-output .hlist dd ol>li:first-child:before,.mw-parser-output .hlist dt ol>li:first-child:before,.mw-parser-output .hlist li ol>li:first-child:before{content:" ("counter(listitem)"\a0 "}</style><style data-mw-deduplicate="TemplateStyles:r4692751">.mw-parser-output .navbar{display:inline;font-size:88%;font-weight:normal}.mw-parser-output .navbar ul{display:inline;white-space:nowrap}.mw-parser-output .navbar li{word-spacing:-0.125em}.mw-parser-output .navbox .navbar{display:block;font-size:100%}.mw-parser-output .navbox-title .navbar{float:left;text-align:left;margin-right:0.5em;width:6em}</style><div class="plainlinks hlist navbar mini"><ul><li class="nv-view"><a href="/wiki/Template:Parser_functions_nav" title="Template:Parser functions nav"><abbr title="View this template" style=";;background:none transparent;border:none;box-shadow:none; padding:0;">v</abbr></a></li><li class="nv-talk"><a href="/wiki/Template_talk:Parser_functions_nav" title="Template talk:Parser functions nav"><abbr title="Discuss this template" style=";;background:none transparent;border:none;box-shadow:none; padding:0;">t</abbr></a></li><li class="nv-edit"><a class="external text" href="https://www.mediawiki.org/w/index.php?title=Template:Parser_functions_nav&action=edit"><abbr title="Edit this template" style=";;background:none transparent;border:none;box-shadow:none; padding:0;">e</abbr></a></li></ul></div><div id="Parser_functions" style="font-size:114%;margin:0 4em"><a href="/wiki/Special:MyLanguage/Manual:Parser_functions" title="Special:MyLanguage/Manual:Parser functions">Parser functions</a><span style="display:none"><a href="/wiki/Manual:Parser_functions" title="Manual:Parser functions"> </a></span></div></th></tr><tr><th scope="row" class="navbox-group" style="width:1%">All</th><td class="navbox-list1 navbox-list navbox-odd" style="width:100%;padding:0px;text-align: left;"><div style="padding:0em 0.25em"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r6387430"><div class="hlist"> <ul><li><b>A</b> {{<a href="/wiki/Special:MyLanguage/anchorencode" title="Special:MyLanguage/anchorencode">#anchorencode</a><span style="display:none"><a href="/wiki/Anchorencode" class="mw-redirect" title="Anchorencode"> </a></span>}}</li> <li><b>B</b> {{<a href="/wiki/Special:MyLanguage/babel" title="Special:MyLanguage/babel">#babel</a><span style="display:none"><a href="/wiki/Babel" class="mw-redirect" title="Babel"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/basepagename" title="Special:MyLanguage/basepagename">#basepagename</a><span style="display:none"><a href="/wiki/Basepagename" class="mw-redirect" title="Basepagename"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/basepagenamee" title="Special:MyLanguage/basepagenamee">#basepagenamee</a><span style="display:none"><a href="/wiki/Basepagenamee" class="mw-redirect" title="Basepagenamee"> </a></span>}}</li> <li><b>C</b> {{<a href="/wiki/Special:MyLanguage/canonicalurl" class="new" title="Special:MyLanguage/canonicalurl (page does not exist)">#canonicalurl</a><span style="display:none"><a href="/w/index.php?title=Canonicalurl&action=edit&redlink=1" class="new" title="Canonicalurl (page does not exist)"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/canonicalurle" class="new" title="Special:MyLanguage/canonicalurle (page does not exist)">#canonicalurle</a><span style="display:none"><a href="/w/index.php?title=Canonicalurle&action=edit&redlink=1" class="new" title="Canonicalurle (page does not exist)"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/Extension:CategoryTree#The_categorytree_parser_function" title="Special:MyLanguage/Extension:CategoryTree">#categorytree</a><span style="display:none"><a href="/wiki/Extension:CategoryTree#The_categorytree_parser_function" title="Extension:CategoryTree"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/Extension:GeoData#Parser_function" title="Special:MyLanguage/Extension:GeoData">#coordinates</a><span style="display:none"><a href="/wiki/Extension:GeoData#Parser_function" title="Extension:GeoData"> </a></span>}}</li> <li><b>D</b> {{<a href="/wiki/Special:MyLanguage/defaultsort" class="new" title="Special:MyLanguage/defaultsort (page does not exist)">#defaultsort</a><span style="display:none"><a href="/w/index.php?title=Defaultsort&action=edit&redlink=1" class="new" title="Defaultsort (page does not exist)"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/displaytitle" title="Special:MyLanguage/displaytitle">#displaytitle</a><span style="display:none"><a href="/wiki/Displaytitle" class="mw-redirect" title="Displaytitle"> </a></span>}}</li> <li><b>E</b> {{<a href="/wiki/Special:MyLanguage/expr" title="Special:MyLanguage/expr">#expr</a><span style="display:none"><a href="/wiki/Expr" class="mw-redirect" title="Expr"> </a></span>}}</li> <li><b>F</b> {{<a href="/wiki/Special:MyLanguage/filepath" class="new" title="Special:MyLanguage/filepath (page does not exist)">#filepath</a><span style="display:none"><a href="/w/index.php?title=Filepath&action=edit&redlink=1" class="new" title="Filepath (page does not exist)"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/formatdate" title="Special:MyLanguage/formatdate">#formatdate</a><span style="display:none"><a href="/wiki/Formatdate" class="mw-redirect" title="Formatdate"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/formatnum" title="Special:MyLanguage/formatnum">#formatnum</a><span style="display:none"><a href="/wiki/Formatnum" class="mw-redirect" title="Formatnum"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/fullpagename" class="new" title="Special:MyLanguage/fullpagename (page does not exist)">#fullpagename</a><span style="display:none"><a href="/w/index.php?title=Fullpagename&action=edit&redlink=1" class="new" title="Fullpagename (page does not exist)"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/fullpagenamee" class="new" title="Special:MyLanguage/fullpagenamee (page does not exist)">#fullpagenamee</a><span style="display:none"><a href="/w/index.php?title=Fullpagenamee&action=edit&redlink=1" class="new" title="Fullpagenamee (page does not exist)"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/fullurl" title="Special:MyLanguage/fullurl">#fullurl</a><span style="display:none"><a href="/wiki/Fullurl" class="mw-redirect" title="Fullurl"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/fullurle" class="new" title="Special:MyLanguage/fullurle (page does not exist)">#fullurle</a><span style="display:none"><a href="/w/index.php?title=Fullurle&action=edit&redlink=1" class="new" title="Fullurle (page does not exist)"> </a></span>}}</li> <li><b>G</b> {{<a href="/wiki/Special:MyLanguage/gender" title="Special:MyLanguage/gender">#gender</a><span style="display:none"><a href="/wiki/Gender" class="mw-redirect" title="Gender"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/grammar" class="new" title="Special:MyLanguage/grammar (page does not exist)">#grammar</a><span style="display:none"><a href="/w/index.php?title=Grammar&action=edit&redlink=1" class="new" title="Grammar (page does not exist)"> </a></span>}}</li> <li><b>I</b> {{<a href="/wiki/Special:MyLanguage/if" title="Special:MyLanguage/if">#if</a><span style="display:none"><a href="/wiki/If" class="mw-redirect" title="If"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/ifeq" title="Special:MyLanguage/ifeq">#ifeq</a><span style="display:none"><a href="/wiki/Ifeq" class="mw-redirect" title="Ifeq"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/iferror" title="Special:MyLanguage/iferror">#iferror</a><span style="display:none"><a href="/wiki/Iferror" class="mw-redirect" title="Iferror"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/ifexist" title="Special:MyLanguage/ifexist">#ifexist</a><span style="display:none"><a href="/wiki/Ifexist" class="mw-redirect" title="Ifexist"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/ifexpr" title="Special:MyLanguage/ifexpr">#ifexpr</a><span style="display:none"><a href="/wiki/Ifexpr" class="mw-redirect" title="Ifexpr"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/int" title="Special:MyLanguage/int">#int</a><span style="display:none"><a href="/wiki/Int" class="mw-redirect" title="Int"> </a></span>}}</li> <li>{{<a href="https://en.wikipedia.org/wiki/Wikipedia:Lua" class="extiw" title="w:Wikipedia:Lua">#invoke</a>}}</li> <li><b>L</b> {{<a href="/wiki/Special:MyLanguage/Help:Magic_words#Miscellaneous" title="Special:MyLanguage/Help:Magic words">#language</a><span style="display:none"><a href="/wiki/Help:Magic_words#Miscellaneous" title="Help:Magic words"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/Help:Magic_words#Formatting" title="Special:MyLanguage/Help:Magic words">#lc</a><span style="display:none"><a href="/wiki/Help:Magic_words#Formatting" title="Help:Magic words"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/lcfirst" title="Special:MyLanguage/lcfirst">#lcfirst</a><span style="display:none"><a href="/wiki/Lcfirst" class="mw-redirect" title="Lcfirst"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/localurl" title="Special:MyLanguage/localurl">#localurl</a><span style="display:none"><a href="/wiki/Localurl" class="mw-redirect" title="Localurl"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/localurle" class="new" title="Special:MyLanguage/localurle (page does not exist)">#localurle</a><span style="display:none"><a href="/w/index.php?title=Localurle&action=edit&redlink=1" class="new" title="Localurle (page does not exist)"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/lqtpagelimit" class="new" title="Special:MyLanguage/lqtpagelimit (page does not exist)">#lqtpagelimit</a><span style="display:none"><a href="/w/index.php?title=Lqtpagelimit&action=edit&redlink=1" class="new" title="Lqtpagelimit (page does not exist)"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/lst" title="Special:MyLanguage/lst">#lst</a><span style="display:none"><a href="/wiki/Lst" class="mw-redirect" title="Lst"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/lstx" title="Special:MyLanguage/lstx">#lstx</a><span style="display:none"><a href="/wiki/Lstx" class="mw-redirect" title="Lstx"> </a></span>}}</li> <li><b>N</b> {{<a href="/wiki/Special:MyLanguage/namespace" title="Special:MyLanguage/namespace">#namespace</a><span style="display:none"><a href="/wiki/Namespace" class="mw-redirect" title="Namespace"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/namespacee" class="new" title="Special:MyLanguage/namespacee (page does not exist)">#namespacee</a><span style="display:none"><a href="/w/index.php?title=Namespacee&action=edit&redlink=1" class="new" title="Namespacee (page does not exist)"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/namespacenumber" class="new" title="Special:MyLanguage/namespacenumber (page does not exist)">#namespacenumber</a><span style="display:none"><a href="/w/index.php?title=Namespacenumber&action=edit&redlink=1" class="new" title="Namespacenumber (page does not exist)"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/ns" title="Special:MyLanguage/ns">#ns</a><span style="display:none"><a href="/wiki/Ns" class="mw-redirect" title="Ns"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/nse" class="new" title="Special:MyLanguage/nse (page does not exist)">#nse</a><span style="display:none"><a href="/w/index.php?title=Nse&action=edit&redlink=1" class="new" title="Nse (page does not exist)"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/numberingroup" class="new" title="Special:MyLanguage/numberingroup (page does not exist)">#numberingroup</a><span style="display:none"><a href="/w/index.php?title=Numberingroup&action=edit&redlink=1" class="new" title="Numberingroup (page does not exist)"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/numberofactiveusers" class="new" title="Special:MyLanguage/numberofactiveusers (page does not exist)">#numberofactiveusers</a><span style="display:none"><a href="/w/index.php?title=Numberofactiveusers&action=edit&redlink=1" class="new" title="Numberofactiveusers (page does not exist)"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/numberofadmins" class="new" title="Special:MyLanguage/numberofadmins (page does not exist)">#numberofadmins</a><span style="display:none"><a href="/w/index.php?title=Numberofadmins&action=edit&redlink=1" class="new" title="Numberofadmins (page does not exist)"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/numberofarticles" class="new" title="Special:MyLanguage/numberofarticles (page does not exist)">#numberofarticles</a><span style="display:none"><a href="/w/index.php?title=Numberofarticles&action=edit&redlink=1" class="new" title="Numberofarticles (page does not exist)"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/numberofedits" class="new" title="Special:MyLanguage/numberofedits (page does not exist)">#numberofedits</a><span style="display:none"><a href="/w/index.php?title=Numberofedits&action=edit&redlink=1" class="new" title="Numberofedits (page does not exist)"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/numberoffiles" class="new" title="Special:MyLanguage/numberoffiles (page does not exist)">#numberoffiles</a><span style="display:none"><a href="/w/index.php?title=Numberoffiles&action=edit&redlink=1" class="new" title="Numberoffiles (page does not exist)"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/numberofpages" class="new" title="Special:MyLanguage/numberofpages (page does not exist)">#numberofpages</a><span style="display:none"><a href="/w/index.php?title=Numberofpages&action=edit&redlink=1" class="new" title="Numberofpages (page does not exist)"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/numberofusers" class="new" title="Special:MyLanguage/numberofusers (page does not exist)">#numberofusers</a><span style="display:none"><a href="/w/index.php?title=Numberofusers&action=edit&redlink=1" class="new" title="Numberofusers (page does not exist)"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/numberofviews" class="new" title="Special:MyLanguage/numberofviews (page does not exist)">#numberofviews</a><span style="display:none"><a href="/w/index.php?title=Numberofviews&action=edit&redlink=1" class="new" title="Numberofviews (page does not exist)"> </a></span>}}</li> <li><b>P</b> {{<a href="/wiki/Special:MyLanguage/padleft" title="Special:MyLanguage/padleft">#padleft</a><span style="display:none"><a href="/wiki/Padleft" class="mw-redirect" title="Padleft"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/padright" class="new" title="Special:MyLanguage/padright (page does not exist)">#padright</a><span style="display:none"><a href="/w/index.php?title=Padright&action=edit&redlink=1" class="new" title="Padright (page does not exist)"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/pagename" class="new" title="Special:MyLanguage/pagename (page does not exist)">#pagename</a><span style="display:none"><a href="/w/index.php?title=Pagename&action=edit&redlink=1" class="new" title="Pagename (page does not exist)"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/pagenamee" title="Special:MyLanguage/pagenamee">#pagenamee</a><span style="display:none"><a href="/wiki/Pagenamee" class="mw-redirect" title="Pagenamee"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/pagesincategory" title="Special:MyLanguage/pagesincategory">#pagesincategory</a><span style="display:none"><a href="/wiki/Pagesincategory" class="mw-redirect" title="Pagesincategory"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/pagesize" title="Special:MyLanguage/pagesize">#pagesize</a><span style="display:none"><a href="/wiki/Pagesize" class="mw-redirect" title="Pagesize"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/plural" class="new" title="Special:MyLanguage/plural (page does not exist)">#plural</a><span style="display:none"><a href="/w/index.php?title=Plural&action=edit&redlink=1" class="new" title="Plural (page does not exist)"> </a></span>}}</li> <li>{{<a href="https://www.wikidata.org/wiki/Wikidata:How_to_use_data_on_Wikimedia_projects" class="extiw" title="d:Wikidata:How to use data on Wikimedia projects">#property</a>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/protectionlevel" class="new" title="Special:MyLanguage/protectionlevel (page does not exist)">#protectionlevel</a><span style="display:none"><a href="/w/index.php?title=Protectionlevel&action=edit&redlink=1" class="new" title="Protectionlevel (page does not exist)"> </a></span>}}</li> <li><b>R</b> {{<a href="/wiki/Special:MyLanguage/rel2abs" class="new" title="Special:MyLanguage/rel2abs (page does not exist)">#rel2abs</a><span style="display:none"><a href="/w/index.php?title=Rel2abs&action=edit&redlink=1" class="new" title="Rel2abs (page does not exist)"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/rootpagename" class="new" title="Special:MyLanguage/rootpagename (page does not exist)">#rootpagename</a><span style="display:none"><a href="/w/index.php?title=Rootpagename&action=edit&redlink=1" class="new" title="Rootpagename (page does not exist)"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/rootpagenamee" class="new" title="Special:MyLanguage/rootpagenamee (page does not exist)">#rootpagenamee</a><span style="display:none"><a href="/w/index.php?title=Rootpagenamee&action=edit&redlink=1" class="new" title="Rootpagenamee (page does not exist)"> </a></span>}}</li> <li><b>S</b> {{<a href="/wiki/Special:MyLanguage/special" class="new" title="Special:MyLanguage/special (page does not exist)">#special</a><span style="display:none"><a href="/w/index.php?title=Special&action=edit&redlink=1" class="new" title="Special (page does not exist)"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/speciale" class="new" title="Special:MyLanguage/speciale (page does not exist)">#speciale</a><span style="display:none"><a href="/w/index.php?title=Speciale&action=edit&redlink=1" class="new" title="Speciale (page does not exist)"> </a></span>}}</li> <li>{{<a href="https://www.wikidata.org/wiki/Wikidata:How_to_use_data_on_Wikimedia_projects" class="extiw" title="d:Wikidata:How to use data on Wikimedia projects">#statement</a>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/subjectpagename" class="new" title="Special:MyLanguage/subjectpagename (page does not exist)">#subjectpagename</a><span style="display:none"><a href="/w/index.php?title=Subjectpagename&action=edit&redlink=1" class="new" title="Subjectpagename (page does not exist)"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/subjectpagenamee" class="new" title="Special:MyLanguage/subjectpagenamee (page does not exist)">#subjectpagenamee</a><span style="display:none"><a href="/w/index.php?title=Subjectpagenamee&action=edit&redlink=1" class="new" title="Subjectpagenamee (page does not exist)"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/subjectspace" class="new" title="Special:MyLanguage/subjectspace (page does not exist)">#subjectspace</a><span style="display:none"><a href="/w/index.php?title=Subjectspace&action=edit&redlink=1" class="new" title="Subjectspace (page does not exist)"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/subjectspacee" class="new" title="Special:MyLanguage/subjectspacee (page does not exist)">#subjectspacee</a><span style="display:none"><a href="/w/index.php?title=Subjectspacee&action=edit&redlink=1" class="new" title="Subjectspacee (page does not exist)"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/subpagename" class="new" title="Special:MyLanguage/subpagename (page does not exist)">#subpagename</a><span style="display:none"><a href="/w/index.php?title=Subpagename&action=edit&redlink=1" class="new" title="Subpagename (page does not exist)"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/subpagenamee" class="new" title="Special:MyLanguage/subpagenamee (page does not exist)">#subpagenamee</a><span style="display:none"><a href="/w/index.php?title=Subpagenamee&action=edit&redlink=1" class="new" title="Subpagenamee (page does not exist)"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/switch" title="Special:MyLanguage/switch">#switch</a><span style="display:none"><a href="/wiki/Switch" class="mw-redirect" title="Switch"> </a></span>}}</li> <li><b>T</b> {{<a href="/wiki/Special:MyLanguage/tag_(parser_function)" title="Special:MyLanguage/tag (parser function)">#tag</a><span style="display:none"><a href="/wiki/Tag_(parser_function)" class="mw-redirect" title="Tag (parser function)"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/talkpagename" class="new" title="Special:MyLanguage/talkpagename (page does not exist)">#talkpagename</a><span style="display:none"><a href="/w/index.php?title=Talkpagename&action=edit&redlink=1" class="new" title="Talkpagename (page does not exist)"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/talkpagenamee" class="new" title="Special:MyLanguage/talkpagenamee (page does not exist)">#talkpagenamee</a><span style="display:none"><a href="/w/index.php?title=Talkpagenamee&action=edit&redlink=1" class="new" title="Talkpagenamee (page does not exist)"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/talkspace" title="Special:MyLanguage/talkspace">#talkspace</a><span style="display:none"><a href="/wiki/Talkspace" class="mw-redirect" title="Talkspace"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/talkspacee" class="new" title="Special:MyLanguage/talkspacee (page does not exist)">#talkspacee</a><span style="display:none"><a href="/w/index.php?title=Talkspacee&action=edit&redlink=1" class="new" title="Talkspacee (page does not exist)"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/time" title="Special:MyLanguage/time">#time</a><span style="display:none"><a href="/wiki/Time" class="mw-redirect" title="Time"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/timel" class="new" title="Special:MyLanguage/timel (page does not exist)">#timel</a><span style="display:none"><a href="/w/index.php?title=Timel&action=edit&redlink=1" class="new" title="Timel (page does not exist)"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/timef" title="Special:MyLanguage/timef">#timef</a><span style="display:none"><a href="/wiki/Timef" class="mw-redirect" title="Timef"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/timefl" class="new" title="Special:MyLanguage/timefl (page does not exist)">#timefl</a><span style="display:none"><a href="/w/index.php?title=Timefl&action=edit&redlink=1" class="new" title="Timefl (page does not exist)"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/titleparts" title="Special:MyLanguage/titleparts">#titleparts</a><span style="display:none"><a href="/wiki/Titleparts" class="mw-redirect" title="Titleparts"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/translation" title="Special:MyLanguage/translation">#translation</a><span style="display:none"><a href="/wiki/Translation" class="mw-disambig" title="Translation"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/translationdialog" class="new" title="Special:MyLanguage/translationdialog (page does not exist)">#translationdialog</a><span style="display:none"><a href="/w/index.php?title=Translationdialog&action=edit&redlink=1" class="new" title="Translationdialog (page does not exist)"> </a></span>}}</li> <li><b>U</b> {{<a href="/wiki/Special:MyLanguage/uc" title="Special:MyLanguage/uc">#uc</a><span style="display:none"><a href="/wiki/Uc" class="mw-redirect" title="Uc"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/ucfirst" title="Special:MyLanguage/ucfirst">#ucfirst</a><span style="display:none"><a href="/wiki/Ucfirst" class="mw-redirect" title="Ucfirst"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/urlencode" title="Special:MyLanguage/urlencode">#urlencode</a><span style="display:none"><a href="/wiki/Urlencode" class="mw-redirect" title="Urlencode"> </a></span>}}</li> <li>{{<a href="/wiki/Special:MyLanguage/useliquidthreads" class="new" title="Special:MyLanguage/useliquidthreads (page does not exist)">#useliquidthreads</a><span style="display:none"><a href="/w/index.php?title=Useliquidthreads&action=edit&redlink=1" class="new" title="Useliquidthreads (page does not exist)"> </a></span>}}</li></ul> </div></div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">See also</th><td class="navbox-list1 navbox-list navbox-even" style="width:100%;padding:0px;text-align: left;"><div style="padding:0em 0.25em"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r6387430"><div class="hlist"> <ul><li><b><a href="/wiki/Special:MyLanguage/Help:Extension:ParserFunctions" title="Special:MyLanguage/Help:Extension:ParserFunctions">Help:Extension:ParserFunctions</a></b><span style="display:none"><a class="mw-selflink selflink"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Help:Parser_functions_in_templates" title="Special:MyLanguage/Help:Parser functions in templates">Help:Parser functions in templates</a><span style="display:none"><a href="/wiki/Help:Parser_functions_in_templates" title="Help:Parser functions in templates"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Parser_extension_tags" title="Special:MyLanguage/Parser extension tags">Parser extension tags</a><span style="display:none"><a href="/wiki/Parser_extension_tags" title="Parser extension tags"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Parser_function_hooks" title="Special:MyLanguage/Parser function hooks">Parser function hooks</a><span style="display:none"><a href="/wiki/Parser_function_hooks" title="Parser function hooks"> </a></span></li></ul> </div></div></td></tr><tr><td class="navbox-abovebelow" colspan="2"><div><b><span class="plainlinks"><a class="external text" href="https://www.mediawiki.org/w/index.php?title=Special:Translate&group=page-Template%3ATranslatable+modules+nav&language=&action=page&filter=">Translate this navigation box</a></span></b></div></td></tr></tbody></table></div> <!-- NewPP limit report Parsed by mw‐web.eqiad.main‐5584645d7f‐xtmrs Cached time: 20241203013343 Cache expiry: 3600 Reduced expiry: true Complications: [show‐toc] DiscussionTools time usage: 0.110 seconds CPU time usage: 1.227 seconds Real time usage: 3.039 seconds Preprocessor visited node count: 40929/1000000 Post‐expand include size: 259714/2097152 bytes Template argument size: 122218/2097152 bytes Highest expansion depth: 19/100 Expensive parser function count: 233/500 Unstrip recursion depth: 0/20 Unstrip post‐expand size: 93022/5000000 bytes Lua time usage: 0.183/10.000 seconds Lua memory usage: 1601643/52428800 bytes Number of Wikibase entities loaded: 0/400 --> <!-- Transclusion expansion time report (%,ms,calls,template) 100.00% 2413.297 1 -total 20.23% 488.109 15 Template:Warning 12.91% 311.623 133 Template:Ll 9.28% 223.915 1 Template:Parser_functions_nav 9.08% 219.012 1 Template:Navbox 8.45% 203.843 6 Template:Xpda 7.94% 191.671 155 Template:Pagelang 7.90% 190.769 266 Template:Translatable 7.43% 179.225 2 Template:Flatlist 6.19% 149.474 192 Template:Xpd/w --> <!-- Saved in parser cache with key mediawikiwiki:pcache:33533:|#|:idhash:canonical and timestamp 20241203013343 and revision id 6816696. Rendering was triggered because: page-view --> </div><!--esi <esi:include src="/esitest-fa8a495983347898/content" /> --><noscript><img src="https://login.wikimedia.org/wiki/Special:CentralAutoLogin/start?type=1x1&useformat=desktop" alt="" width="1" height="1" style="border: none; position: absolute;"></noscript> <div class="printfooter" data-nosnippet="">Retrieved from "<a dir="ltr" href="https://www.mediawiki.org/w/index.php?title=Help:Extension:ParserFunctions&oldid=6816696#ifexist">https://www.mediawiki.org/w/index.php?title=Help:Extension:ParserFunctions&oldid=6816696#ifexist</a>"</div></div> <div id="catlinks" class="catlinks" data-mw="interface"><div id="mw-normal-catlinks" class="mw-normal-catlinks"><a href="/wiki/Special:Categories" title="Special:Categories">Categories</a>: <ul><li><a href="/wiki/Category:Extension_help" title="Category:Extension help">Extension help</a></li><li><a href="/wiki/Category:Magic_words" title="Category:Magic words">Magic words</a></li></ul></div></div> </div> </main> </div> <div class="mw-footer-container"> <footer id="footer" class="mw-footer" > <ul id="footer-info"> <li id="footer-info-lastmod"> This page was last edited on 28 October 2024, at 11:23.</li> <li id="footer-info-copyright">Text is available under the <a rel="nofollow" class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-ShareAlike License</a>; additional terms may apply. Text in <a class="external text" href="https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents">the Help: namespace</a> is available under the <a rel="nofollow" class="external text" href="https://creativecommons.org/publicdomain/zero/1.0/">Creative Commons CC0 License</a>. By using this site, you agree to the <a class="external text" href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Terms_of_Use">Terms of Use</a> and <a class="external text" href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Privacy_policy">Privacy Policy</a>.</li> </ul> <ul id="footer-places"> <li id="footer-places-privacy"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Privacy_policy">Privacy policy</a></li> <li id="footer-places-about"><a href="/wiki/Project:About">About mediawiki.org</a></li> <li id="footer-places-disclaimers"><a href="/wiki/Project:General_disclaimer">Disclaimers</a></li> <li id="footer-places-wm-codeofconduct"><a href="https://www.mediawiki.org/wiki/Special:MyLanguage/Code_of_Conduct">Code of Conduct</a></li> <li id="footer-places-developers"><a href="https://developer.wikimedia.org">Developers</a></li> <li id="footer-places-statslink"><a href="https://stats.wikimedia.org/#/www.mediawiki.org">Statistics</a></li> <li id="footer-places-cookiestatement"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Cookie_statement">Cookie statement</a></li> <li id="footer-places-mobileview"><a href="//m.mediawiki.org/w/index.php?title=Help:Extension:ParserFunctions&mobileaction=toggle_view_mobile#ifexist" class="noprint stopMobileRedirectToggle">Mobile view</a></li> </ul> <ul id="footer-icons" class="noprint"> <li id="footer-copyrightico"><a href="https://wikimediafoundation.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/static/images/footer/wikimedia-button.svg" width="84" height="29" alt="Wikimedia Foundation" loading="lazy"></a></li> <li id="footer-poweredbyico"><a href="https://www.mediawiki.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/w/resources/assets/poweredby_mediawiki.svg" alt="Powered by MediaWiki" width="88" height="31" loading="lazy"></a></li> </ul> </footer> </div> </div> </div> <div class="vector-settings" id="p-dock-bottom"> <ul></ul> </div><script>(RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgHostname":"mw-web.codfw.main-79d9bc49cc-gnt5l","wgBackendResponseTime":122,"wgDiscussionToolsPageThreads":[{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-#expr","replies":[{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-Rounding-#expr","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-Strings-#expr","replies":[]}]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-#if","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-#ifeq","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-#iferror","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-#ifexpr","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-#ifexist","replies":[{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-ifexist_limits-#ifexist","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-ifexist_and_wanted_pages-#ifexist","replies":[]}]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-#rel2abs","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-#switch","replies":[{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-Default-#switch","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-Grouping_results-#switch","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-Use_with_parameters-#switch","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-Comparison_behavior-#switch","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-Raw_equal_signs-#switch","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-Replacing_#ifeq-#switch","replies":[]}]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-#time","replies":[{"headingLevel":4,"name":"h-","type":"heading","level":0,"id":"h-Time_Zone_issue-#time","replies":[]},{"headingLevel":4,"name":"h-","type":"heading","level":0,"id":"h-#time_format_like_in_signatures-#time","replies":[]}]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-#timel","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-#timef","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-#timefl","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-#titleparts","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-String_functions","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-General_points","replies":[{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-Substitution-General_points","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-Redirects-General_points","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-Escaping_pipe_characters_in_tables-General_points","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-Stripping_whitespace-General_points","replies":[]}]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-Other_parser_functions","replies":[{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-Case_conversion_functions-Other_parser_functions","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-Encoding_functions-Other_parser_functions","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-Anchor_encoding-Other_parser_functions","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-Padding_functions-Other_parser_functions","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-Formatting_functions-Other_parser_functions","replies":[]}]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-See_also","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-References","replies":[]}],"wgPageParseReport":{"discussiontools":{"limitreport-timeusage":"0.110"},"limitreport":{"cputime":"1.227","walltime":"3.039","ppvisitednodes":{"value":40929,"limit":1000000},"postexpandincludesize":{"value":259714,"limit":2097152},"templateargumentsize":{"value":122218,"limit":2097152},"expansiondepth":{"value":19,"limit":100},"expensivefunctioncount":{"value":233,"limit":500},"unstrip-depth":{"value":0,"limit":20},"unstrip-size":{"value":93022,"limit":5000000},"entityaccesscount":{"value":0,"limit":400},"timingprofile":["100.00% 2413.297 1 -total"," 20.23% 488.109 15 Template:Warning"," 12.91% 311.623 133 Template:Ll"," 9.28% 223.915 1 Template:Parser_functions_nav"," 9.08% 219.012 1 Template:Navbox"," 8.45% 203.843 6 Template:Xpda"," 7.94% 191.671 155 Template:Pagelang"," 7.90% 190.769 266 Template:Translatable"," 7.43% 179.225 2 Template:Flatlist"," 6.19% 149.474 192 Template:Xpd/w"]},"scribunto":{"limitreport-timeusage":{"value":"0.183","limit":"10.000"},"limitreport-memusage":{"value":1601643,"limit":52428800}},"cachereport":{"origin":"mw-web.eqiad.main-5584645d7f-xtmrs","timestamp":"20241203013343","ttl":3600,"transientcontent":true}}});});</script> </body> </html>