CINXE.COM
Help:Substitution - MediaWiki
<!DOCTYPE html> <html class="client-nojs vector-feature-language-in-header-disabled vector-feature-language-in-main-page-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-sticky-header-enabled vector-toc-available" lang="en" dir="ltr"> <head> <meta charset="UTF-8"> <title>Help:Substitution - MediaWiki</title> <script>(function(){var className="client-js vector-feature-language-in-header-disabled vector-feature-language-in-main-page-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-sticky-header-enabled 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":"0fe73606-4ed7-44b2-a987-3526b5a3aa6a","wgCanonicalNamespace":"Help","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":12,"wgPageName":"Help:Substitution","wgTitle":"Substitution","wgCurRevisionId":7020264,"wgRevisionId":7020264,"wgArticleId":42730,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":["Templates"],"wgPageViewLanguage":"en","wgPageContentLanguage":"en","wgPageContentModel":"wikitext","wgRelevantPageName":"Help:Substitution","wgRelevantArticleId":42730,"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":50000,"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":"Q6402671","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.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","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=["site","mediawiki.page.ready","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"];</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.discussionTools.init.styles%7Cext.translate%2CwikimediaBadges%7Cext.translate.edit.documentation.styles%7Cext.translate.tag.languages%7Cext.uls.pt%7Cext.visualEditor.desktopArticleTarget.noscript%7Cext.wikimediamessages.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.16"> <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:Substitution - 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:Substitution"> <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:Substitution"> <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_Substitution rootpage-Help_Substitution 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" title="Main menu" > <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-specialpages" class="mw-list-item"><a href="/wiki/Special:SpecialPages"><span>Special pages</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-ar mw-list-item"><a href="https://ar.wikipedia.org/wiki/%D9%85%D8%B3%D8%A7%D8%B9%D8%AF%D8%A9:%D9%86%D8%B3%D8%AE" title="مساعدة:نسخ – Arabic" lang="ar" hreflang="ar" data-title="مساعدة:نسخ" data-language-autonym="العربية" data-language-local-name="Arabic" class="interlanguage-link-target"><span>العربية</span></a></li><li class="interlanguage-link interwiki-as mw-list-item"><a href="https://as.wikipedia.org/wiki/%E0%A6%B8%E0%A6%B9%E0%A6%BE%E0%A6%AF%E0%A6%BC:Subst" title="সহায়:Subst – Assamese" lang="as" hreflang="as" data-title="সহায়:Subst" data-language-autonym="অসমীয়া" data-language-local-name="Assamese" class="interlanguage-link-target"><span>অসমীয়া</span></a></li><li class="interlanguage-link interwiki-azb mw-list-item"><a href="https://azb.wikipedia.org/wiki/%D9%88%DB%8C%DA%A9%DB%8C%E2%80%8C%D9%BE%D8%AF%DB%8C%D8%A7:%D8%B9%D9%88%D8%B6%E2%80%8C%D8%A7%D8%A6%D8%AA%D9%85%D9%87" title="ویکیپدیا:عوضائتمه – South Azerbaijani" lang="azb" hreflang="azb" data-title="ویکیپدیا:عوضائتمه" data-language-autonym="تۆرکجه" data-language-local-name="South Azerbaijani" class="interlanguage-link-target"><span>تۆرکجه</span></a></li><li class="interlanguage-link interwiki-bh mw-list-item"><a href="https://bh.wikipedia.org/wiki/%E0%A4%AE%E0%A4%A6%E0%A4%A6:Substitution" title="मदद:Substitution – Bhojpuri" lang="bh" hreflang="bh" data-title="मदद:Substitution" data-language-autonym="भोजपुरी" data-language-local-name="Bhojpuri" class="interlanguage-link-target"><span>भोजपुरी</span></a></li><li class="interlanguage-link interwiki-bn mw-list-item"><a href="https://bn.wikipedia.org/wiki/%E0%A6%B8%E0%A6%BE%E0%A6%B9%E0%A6%BE%E0%A6%AF%E0%A7%8D%E0%A6%AF:%E0%A6%89%E0%A6%AA%E0%A6%95%E0%A6%B2%E0%A7%8D%E0%A6%AA%E0%A6%A8" title="সাহায্য:উপকল্পন – Bangla" lang="bn" hreflang="bn" data-title="সাহায্য:উপকল্পন" data-language-autonym="বাংলা" data-language-local-name="Bangla" class="interlanguage-link-target"><span>বাংলা</span></a></li><li class="interlanguage-link interwiki-ca mw-list-item"><a href="https://ca.wikipedia.org/wiki/Ajuda:Substituci%C3%B3" title="Ajuda:Substitució – Catalan" lang="ca" hreflang="ca" data-title="Ajuda:Substitució" data-language-autonym="Català" data-language-local-name="Catalan" class="interlanguage-link-target"><span>Català</span></a></li><li class="interlanguage-link interwiki-da mw-list-item"><a href="https://da.wikipedia.org/wiki/Hj%C3%A6lp:Skabelonssubstitution" title="Hjælp:Skabelonssubstitution – Danish" lang="da" hreflang="da" data-title="Hjælp:Skabelonssubstitution" data-language-autonym="Dansk" data-language-local-name="Danish" class="interlanguage-link-target"><span>Dansk</span></a></li><li class="interlanguage-link interwiki-dv mw-list-item"><a href="https://dv.wikipedia.org/wiki/%DE%88%DE%A8%DE%86%DE%A8%DE%95%DE%A9%DE%91%DE%A8%DE%87%DE%A7:Template_substitution" title="ވިކިޕީޑިއާ:Template substitution – Divehi" lang="dv" hreflang="dv" data-title="ވިކިޕީޑިއާ:Template substitution" data-language-autonym="ދިވެހިބަސް" data-language-local-name="Divehi" class="interlanguage-link-target"><span>ދިވެހިބަސް</span></a></li><li class="interlanguage-link interwiki-en mw-list-item"><a href="https://en.wikipedia.org/wiki/Help:Substitution" title="Help:Substitution – English" lang="en" hreflang="en" data-title="Help:Substitution" data-language-autonym="English" data-language-local-name="English" class="interlanguage-link-target"><span>English</span></a></li><li class="interlanguage-link interwiki-eo mw-list-item"><a href="https://eo.wikipedia.org/wiki/Helpo:Anstata%C5%ADigilo" title="Helpo:Anstataŭigilo – Esperanto" lang="eo" hreflang="eo" data-title="Helpo:Anstataŭigilo" data-language-autonym="Esperanto" data-language-local-name="Esperanto" class="interlanguage-link-target"><span>Esperanto</span></a></li><li class="interlanguage-link interwiki-fa mw-list-item"><a href="https://fa.wikipedia.org/wiki/%D9%88%DB%8C%DA%A9%DB%8C%E2%80%8C%D9%BE%D8%AF%DB%8C%D8%A7:%D8%AC%D8%A7%D9%86%D8%B4%D8%A7%D9%86%DB%8C" title="ویکیپدیا:جانشانی – Persian" lang="fa" hreflang="fa" data-title="ویکیپدیا:جانشانی" data-language-autonym="فارسی" data-language-local-name="Persian" class="interlanguage-link-target"><span>فارسی</span></a></li><li class="interlanguage-link interwiki-fi mw-list-item"><a href="https://fi.wikipedia.org/wiki/Ohje:Substaus" title="Ohje:Substaus – Finnish" lang="fi" hreflang="fi" data-title="Ohje:Substaus" data-language-autonym="Suomi" data-language-local-name="Finnish" class="interlanguage-link-target"><span>Suomi</span></a></li><li class="interlanguage-link interwiki-gu mw-list-item"><a href="https://gu.wikipedia.org/wiki/%E0%AA%B5%E0%AA%BF%E0%AA%95%E0%AA%BF%E0%AA%AA%E0%AB%80%E0%AA%A1%E0%AA%BF%E0%AA%AF%E0%AA%BE:Substitution" title="વિકિપીડિયા:Substitution – Gujarati" lang="gu" hreflang="gu" data-title="વિકિપીડિયા:Substitution" data-language-autonym="ગુજરાતી" data-language-local-name="Gujarati" class="interlanguage-link-target"><span>ગુજરાતી</span></a></li><li class="interlanguage-link interwiki-hi mw-list-item"><a href="https://hi.wikipedia.org/wiki/%E0%A4%B5%E0%A4%BF%E0%A4%95%E0%A4%BF%E0%A4%AA%E0%A5%80%E0%A4%A1%E0%A4%BF%E0%A4%AF%E0%A4%BE:%E0%A4%B8%E0%A4%BE%E0%A4%81%E0%A4%9A%E0%A4%BE_%E0%A4%AA%E0%A5%8D%E0%A4%B0%E0%A4%A4%E0%A4%BF%E0%A4%B8%E0%A5%8D%E0%A4%A5%E0%A4%BE%E0%A4%AA%E0%A4%A8" title="विकिपीडिया:साँचा प्रतिस्थापन – Hindi" lang="hi" hreflang="hi" data-title="विकिपीडिया:साँचा प्रतिस्थापन" data-language-autonym="हिन्दी" data-language-local-name="Hindi" class="interlanguage-link-target"><span>हिन्दी</span></a></li><li class="interlanguage-link interwiki-id mw-list-item"><a href="https://id.wikipedia.org/wiki/Wikipedia:Substitusi" title="Wikipedia:Substitusi – Indonesian" lang="id" hreflang="id" data-title="Wikipedia:Substitusi" 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-ilo mw-list-item"><a href="https://ilo.wikipedia.org/wiki/Wikipedia:Pangisukat" title="Wikipedia:Pangisukat – Iloko" lang="ilo" hreflang="ilo" data-title="Wikipedia:Pangisukat" data-language-autonym="Ilokano" data-language-local-name="Iloko" class="interlanguage-link-target"><span>Ilokano</span></a></li><li class="interlanguage-link interwiki-it mw-list-item"><a href="https://it.wikipedia.org/wiki/Aiuto:Subst" title="Aiuto:Subst – Italian" lang="it" hreflang="it" data-title="Aiuto:Subst" data-language-autonym="Italiano" data-language-local-name="Italian" class="interlanguage-link-target"><span>Italiano</span></a></li><li class="interlanguage-link interwiki-la mw-list-item"><a href="https://la.wikipedia.org/wiki/Auxilium:Substitutio" title="Auxilium:Substitutio – Latin" lang="la" hreflang="la" data-title="Auxilium:Substitutio" data-language-autonym="Latina" data-language-local-name="Latin" class="interlanguage-link-target"><span>Latina</span></a></li><li class="interlanguage-link interwiki-ml mw-list-item"><a href="https://ml.wikipedia.org/wiki/%E0%B4%B5%E0%B4%BF%E0%B4%95%E0%B5%8D%E0%B4%95%E0%B4%BF%E0%B4%AA%E0%B5%80%E0%B4%A1%E0%B4%BF%E0%B4%AF:Substitution" title="വിക്കിപീഡിയ:Substitution – Malayalam" lang="ml" hreflang="ml" data-title="വിക്കിപീഡിയ:Substitution" data-language-autonym="മലയാളം" data-language-local-name="Malayalam" class="interlanguage-link-target"><span>മലയാളം</span></a></li><li class="interlanguage-link interwiki-mr mw-list-item"><a href="https://mr.wikipedia.org/wiki/%E0%A4%B5%E0%A4%BF%E0%A4%95%E0%A4%BF%E0%A4%AA%E0%A5%80%E0%A4%A1%E0%A4%BF%E0%A4%AF%E0%A4%BE:Substitution" title="विकिपीडिया:Substitution – Marathi" lang="mr" hreflang="mr" data-title="विकिपीडिया:Substitution" data-language-autonym="मराठी" data-language-local-name="Marathi" class="interlanguage-link-target"><span>मराठी</span></a></li><li class="interlanguage-link interwiki-mt mw-list-item"><a href="https://mt.wikipedia.org/wiki/G%C4%A7ajnuna:Substitution" title="Għajnuna:Substitution – Maltese" lang="mt" hreflang="mt" data-title="Għajnuna:Substitution" data-language-autonym="Malti" data-language-local-name="Maltese" class="interlanguage-link-target"><span>Malti</span></a></li><li class="interlanguage-link interwiki-my mw-list-item"><a href="https://my.wikipedia.org/wiki/%E1%80%9D%E1%80%AE%E1%80%80%E1%80%AE%E1%80%95%E1%80%AE%E1%80%B8%E1%80%92%E1%80%AE%E1%80%B8%E1%80%9A%E1%80%AC%E1%80%B8:Substitution" title="ဝီကီပီးဒီးယား:Substitution – Burmese" lang="my" hreflang="my" data-title="ဝီကီပီးဒီးယား:Substitution" data-language-autonym="မြန်မာဘာသာ" data-language-local-name="Burmese" class="interlanguage-link-target"><span>မြန်မာဘာသာ</span></a></li><li class="interlanguage-link interwiki-or mw-list-item"><a href="https://or.wikipedia.org/wiki/%E0%AC%89%E0%AC%87%E0%AC%95%E0%AC%BF%E0%AC%AA%E0%AC%BF%E0%AC%A1%E0%AC%BC%E0%AC%BF%E0%AC%86:Substitution" title="ଉଇକିପିଡ଼ିଆ:Substitution – Odia" lang="or" hreflang="or" data-title="ଉଇକିପିଡ଼ିଆ:Substitution" data-language-autonym="ଓଡ଼ିଆ" data-language-local-name="Odia" class="interlanguage-link-target"><span>ଓଡ଼ିଆ</span></a></li><li class="interlanguage-link interwiki-ps mw-list-item"><a href="https://ps.wikipedia.org/wiki/%D9%88%D9%8A%DA%A9%D9%8A%D9%BE%DB%90%DA%89%D9%8A%D8%A7:%D8%A8%D8%AF%D9%8A%D9%84" title="ويکيپېډيا:بديل – Pashto" lang="ps" hreflang="ps" data-title="ويکيپېډيا:بديل" data-language-autonym="پښتو" data-language-local-name="Pashto" class="interlanguage-link-target"><span>پښتو</span></a></li><li class="interlanguage-link interwiki-pt mw-list-item"><a href="https://pt.wikipedia.org/wiki/Wikip%C3%A9dia:Substitui%C3%A7%C3%A3o" title="Wikipédia:Substituição – Portuguese" lang="pt" hreflang="pt" data-title="Wikipédia:Substituição" 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-ro mw-list-item"><a href="https://ro.wikipedia.org/wiki/Wikipedia:Substitu%C8%9Bie" title="Wikipedia:Substituție – Romanian" lang="ro" hreflang="ro" data-title="Wikipedia:Substituție" data-language-autonym="Română" data-language-local-name="Romanian" class="interlanguage-link-target"><span>Română</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%9F%D0%BE%D0%B4%D1%81%D1%82%D0%B0%D0%BD%D0%BE%D0%B2%D0%BA%D0%B0_%D1%88%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD%D0%BE%D0%B2" 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-sd mw-list-item"><a href="https://sd.wikipedia.org/wiki/%D9%85%D8%AF%D8%AF:Substitution" title="مدد:Substitution – Sindhi" lang="sd" hreflang="sd" data-title="مدد:Substitution" data-language-autonym="سنڌي" data-language-local-name="Sindhi" class="interlanguage-link-target"><span>سنڌي</span></a></li><li class="interlanguage-link interwiki-sh mw-list-item"><a href="https://sh.wikipedia.org/wiki/Wikipedija:Supstitucija_%C5%A1ablona" title="Wikipedija:Supstitucija šablona – Serbo-Croatian" lang="sh" hreflang="sh" data-title="Wikipedija:Supstitucija šablona" data-language-autonym="Srpskohrvatski / српскохрватски" data-language-local-name="Serbo-Croatian" class="interlanguage-link-target"><span>Srpskohrvatski / српскохрватски</span></a></li><li class="interlanguage-link interwiki-shn mw-list-item"><a href="https://shn.wikipedia.org/wiki/%E1%80%9D%E1%80%AE%E1%82%87%E1%81%B6%E1%80%AE%E1%82%87%E1%81%BD%E1%80%AE%E1%80%B8%E1%80%90%E1%80%AE%E1%80%B8%E1%80%9A%E1%82%83%E1%80%B8:Substitution" title="ဝီႇၶီႇၽီးတီးယႃး:Substitution – Shan" lang="shn" hreflang="shn" data-title="ဝီႇၶီႇၽီးတီးယႃး:Substitution" data-language-autonym="ၽႃႇသႃႇတႆး " data-language-local-name="Shan" class="interlanguage-link-target"><span>ၽႃႇသႃႇတႆး </span></a></li><li class="interlanguage-link interwiki-si mw-list-item"><a href="https://si.wikipedia.org/wiki/%E0%B6%8B%E0%B6%AF%E0%B7%80%E0%B7%94:%E0%B6%86%E0%B6%AF%E0%B7%9A%E0%B7%81%E0%B6%B1%E0%B6%BA" title="උදවු:ආදේශනය – Sinhala" lang="si" hreflang="si" data-title="උදවු:ආදේශනය" data-language-autonym="සිංහල" data-language-local-name="Sinhala" class="interlanguage-link-target"><span>සිංහල</span></a></li><li class="interlanguage-link interwiki-simple mw-list-item"><a href="https://simple.wikipedia.org/wiki/Wikipedia:Template_substitution" title="Wikipedia:Template substitution – Simple English" lang="en-simple" hreflang="en-simple" data-title="Wikipedia:Template substitution" 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/Wikipedija:Substitucija_predlog" title="Wikipedija:Substitucija predlog – Slovenian" lang="sl" hreflang="sl" data-title="Wikipedija:Substitucija predlog" 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-sr mw-list-item"><a href="https://sr.wikipedia.org/wiki/%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%98%D0%B0:%D0%A1%D1%83%D0%BF%D1%81%D1%82%D0%B8%D1%82%D1%83%D1%86%D0%B8%D1%98%D0%B0" title="Википедија:Супституција – Serbian" lang="sr" hreflang="sr" data-title="Википедија:Супституција" data-language-autonym="Српски / srpski" data-language-local-name="Serbian" class="interlanguage-link-target"><span>Српски / srpski</span></a></li><li class="interlanguage-link interwiki-sv mw-list-item"><a href="https://sv.wikipedia.org/wiki/Wikipedia:Substitution" title="Wikipedia:Substitution – Swedish" lang="sv" hreflang="sv" data-title="Wikipedia:Substitution" data-language-autonym="Svenska" data-language-local-name="Swedish" class="interlanguage-link-target"><span>Svenska</span></a></li><li class="interlanguage-link interwiki-uk mw-list-item"><a href="https://uk.wikipedia.org/wiki/%D0%92%D1%96%D0%BA%D1%96%D0%BF%D0%B5%D0%B4%D1%96%D1%8F:%D0%9F%D1%96%D0%B4%D1%81%D1%82%D0%B0%D0%BD%D0%BE%D0%B2%D0%BA%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-vi mw-list-item"><a href="https://vi.wikipedia.org/wiki/Wikipedia:Thay_th%E1%BA%BF_b%E1%BA%A3n_m%E1%BA%ABu" title="Wikipedia:Thay thế bản mẫu – Vietnamese" lang="vi" hreflang="vi" data-title="Wikipedia:Thay thế bản mẫu" 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-zh mw-list-item"><a href="https://zh.wikipedia.org/wiki/Help:%E6%9B%BF%E6%8D%A2%E5%BC%95%E7%94%A8" 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/Q6402671#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.org" aria-label="Search mediawiki.org" 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%3ASubstitution" 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%3ASubstitution" 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%3ASubstitution" 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%3ASubstitution" 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-Applications" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Applications"> <div class="vector-toc-text"> <span class="vector-toc-numb">1</span> <span>Applications</span> </div> </a> <ul id="toc-Applications-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Overview" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Overview"> <div class="vector-toc-text"> <span class="vector-toc-numb">2</span> <span>Overview</span> </div> </a> <ul id="toc-Overview-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Usage_considerations" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Usage_considerations"> <div class="vector-toc-text"> <span class="vector-toc-numb">3</span> <span>Usage considerations</span> </div> </a> <button aria-controls="toc-Usage_considerations-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 Usage considerations subsection</span> </button> <ul id="toc-Usage_considerations-sublist" class="vector-toc-list"> <li id="toc-Ordinary_templates" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Ordinary_templates"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.1</span> <span>Ordinary templates</span> </div> </a> <ul id="toc-Ordinary_templates-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Predefined_templates" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Predefined_templates"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.2</span> <span>Predefined templates</span> </div> </a> <ul id="toc-Predefined_templates-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-Partial_substitution" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Partial_substitution"> <div class="vector-toc-text"> <span class="vector-toc-numb">4</span> <span>Partial substitution</span> </div> </a> <ul id="toc-Partial_substitution-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Multilevel_substitution" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Multilevel_substitution"> <div class="vector-toc-text"> <span class="vector-toc-numb">5</span> <span>Multilevel substitution</span> </div> </a> <ul id="toc-Multilevel_substitution-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Multilevel_substitution_with_independent_control_of_each_substitution_separately" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Multilevel_substitution_with_independent_control_of_each_substitution_separately"> <div class="vector-toc-text"> <span class="vector-toc-numb">6</span> <span>Multilevel substitution with independent control of each substitution separately</span> </div> </a> <button aria-controls="toc-Multilevel_substitution_with_independent_control_of_each_substitution_separately-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 Multilevel substitution with independent control of each substitution separately subsection</span> </button> <ul id="toc-Multilevel_substitution_with_independent_control_of_each_substitution_separately-sublist" class="vector-toc-list"> <li id="toc-Partial_substitution_2" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Partial_substitution_2"> <div class="vector-toc-text"> <span class="vector-toc-numb">6.1</span> <span>Partial substitution</span> </div> </a> <ul id="toc-Partial_substitution_2-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Composite_operations" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Composite_operations"> <div class="vector-toc-text"> <span class="vector-toc-numb">6.2</span> <span>Composite operations</span> </div> </a> <ul id="toc-Composite_operations-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-includeonly" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#includeonly"> <div class="vector-toc-text"> <span class="vector-toc-numb">7</span> <span>includeonly</span> </div> </a> <ul id="toc-includeonly-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Creating_a_page_which_applies_substitution_on_the_next_save" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Creating_a_page_which_applies_substitution_on_the_next_save"> <div class="vector-toc-text"> <span class="vector-toc-numb">8</span> <span>Creating a page which applies substitution on the next save</span> </div> </a> <ul id="toc-Creating_a_page_which_applies_substitution_on_the_next_save-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Forced_substitution" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Forced_substitution"> <div class="vector-toc-text"> <span class="vector-toc-numb">9</span> <span>Forced substitution</span> </div> </a> <ul id="toc-Forced_substitution-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Substitution_of_part_of_the_parameters" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Substitution_of_part_of_the_parameters"> <div class="vector-toc-text"> <span class="vector-toc-numb">10</span> <span>Substitution of part of the parameters</span> </div> </a> <ul id="toc-Substitution_of_part_of_the_parameters-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Limitations" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Limitations"> <div class="vector-toc-text"> <span class="vector-toc-numb">11</span> <span>Limitations</span> </div> </a> <ul id="toc-Limitations-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Documenting_substitution" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Documenting_substitution"> <div class="vector-toc-text"> <span class="vector-toc-numb">12</span> <span>Documenting substitution</span> </div> </a> <ul id="toc-Documenting_substitution-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-See_also" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#See_also"> <div class="vector-toc-text"> <span class="vector-toc-numb">13</span> <span>See also</span> </div> </a> <ul id="toc-See_also-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" title="Table of Contents" > <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">Substitution</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:Substitution" 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:Substitution" 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:Substitution"><span>Read</span></a></li><li id="ca-viewsource" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Help:Substitution&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:Substitution&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:Substitution"><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:Substitution&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:Substitution&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:Substitution" 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:Substitution" 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-permalink" class="mw-list-item"><a href="/w/index.php?title=Help:Substitution&oldid=7020264" 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:Substitution&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%3ASubstitution"><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%3ASubstitution"><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%3ASubstitution"><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%3ASubstitution&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:Substitution&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-commons mw-list-item"><a href="https://commons.wikimedia.org/wiki/Category:Templates_which_must_be_substituted" hreflang="en"><span>Wikimedia Commons</span></a></li><li class="wb-otherproject-link wb-otherproject-meta mw-list-item"><a href="https://meta.wikimedia.org/wiki/Help:Substitution" hreflang="en"><span>Meta-Wiki</span></a></li><li class="wb-otherproject-link wb-otherproject-wikidata mw-list-item"><a href="https://www.wikidata.org/wiki/Help:Substitution" hreflang="en"><span>Wikidata</span></a></li><li class="wb-otherproject-link wb-otherproject-wikipedia mw-list-item"><a href="https://en.wikipedia.org/wiki/Help:Substitution" 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/Q6402671" 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%3ASubstitution&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:Substitution/id" class="mw-pt-progress mw-pt-progress--low" title="Bantuan:Substitusi (5% translated)" lang="id" dir="ltr">Bahasa Indonesia</a></li> <li><a href="/wiki/Help:Substitution/de" class="mw-pt-progress mw-pt-progress--low" title="Hilfe:Substitution (4% 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:Substitution/tr" class="mw-pt-progress mw-pt-progress--low" title="Yardım:İkame (0% translated)" lang="tr" dir="ltr">Türkçe</a></li> <li><a href="/wiki/Help:Substitution/fr" class="mw-pt-progress mw-pt-progress--high" title="Aide:Substitution (99% translated)" lang="fr" dir="ltr">français</a></li> <li><a href="/wiki/Help:Substitution/pl" class="mw-pt-progress mw-pt-progress--low" title="Pomoc:Podstawianie (5% translated)" lang="pl" dir="ltr">polski</a></li> <li><a href="/wiki/Help:Substitution/sv" class="mw-pt-progress mw-pt-progress--low" title="Hjälp:Ersätt (12% translated)" lang="sv" dir="ltr">svenska</a></li> <li><a href="/wiki/Help:Substitution/cs" class="mw-pt-progress mw-pt-progress--complete" title="Nápověda:Nahrazení (100% translated)" lang="cs" dir="ltr">čeština</a></li> <li><a href="/wiki/Help:Substitution/ru" class="mw-pt-progress mw-pt-progress--med" title="Справка:Подстановка (23% translated)" lang="ru" dir="ltr">русский</a></li> <li><a href="/wiki/Help:Substitution/uk" class="mw-pt-progress mw-pt-progress--low" title="Допомога:Підставляння (1% translated)" lang="uk" dir="ltr">українська</a></li> <li><a href="/wiki/Help:Substitution/bho" class="mw-pt-progress mw-pt-progress--low" title="मदद:प्रतिस्थापन (2% translated)" lang="bho" dir="ltr">भोजपुरी</a></li> <li><a href="/wiki/Help:Substitution/bn" class="mw-pt-progress mw-pt-progress--low" title="সাহায্য: প্রতিস্থাপন (1% translated)" lang="bn" dir="ltr">বাংলা</a></li> <li><a href="/wiki/Help:Substitution/blk" class="mw-pt-progress mw-pt-progress--low" title="အစွဲးအကမ်း:ထာꩻလုဲင်ႏသော့ꩻခြောင်ꩻ (1% translated)" lang="blk" dir="ltr">ပအိုဝ်ႏဘာႏသာႏ</a></li> <li><a href="/wiki/Help:Substitution/zh" class="mw-pt-progress mw-pt-progress--med" title="Help:替换引用 (15% translated)" lang="zh" dir="ltr">中文</a></li> <li><a href="/wiki/Help:Substitution/ja" class="mw-pt-progress mw-pt-progress--med" title="Help:Subst展開 (41% translated)" lang="ja" dir="ltr">日本語</a></li> <li><a href="/wiki/Help:Substitution/ko" class="mw-pt-progress mw-pt-progress--low" title="도움말:문자열 대체 (1% translated)" lang="ko" dir="ltr">한국어</a></li></ul></div> <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. <br/><b>Some old revisions for this page were imported under CC BY-SA license. Only new contributions are PD.</b> </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> <p><b>Substitution</b> is <a href="/wiki/Special:MyLanguage/Help:Pre-save_transform" title="Special:MyLanguage/Help:Pre-save transform">automatic conversion of wikitext</a> of a page when the page is saved, in the case that the wikitext refers to one or more <a href="/wiki/Special:MyLanguage/Help:Templates" title="Special:MyLanguage/Help:Templates">templates</a>, <a href="/wiki/Special:MyLanguage/Help:variable" title="Special:MyLanguage/Help:variable">variables</a>, or <a href="/wiki/Special:MyLanguage/Help:parser_function" title="Special:MyLanguage/Help:parser function">parser functions</a>. </p><p>In the case of template substitution the template call is replaced by the template content with substitution of the parameters. Thus a template is used as <a href="https://en.wiktionary.org/wiki/en:macro" class="extiw" title="wikt:en:macro">macro</a> and the page is <a href="https://en.wiktionary.org/wiki/en:macro_expansion" class="extiw" title="wikt:en:macro expansion">macro expanded</a> when the page is saved rather than, as usually happens, when the page is viewed. </p><p>In the case of substitution of a variable or parser function the reference to it is replaced by the resulting value. </p><p>Substitution is done by putting the <a href="/wiki/Special:MyLanguage/Help:Magic_Words" title="Special:MyLanguage/Help:Magic Words">magic word</a> <code>subst:</code> or <code>safesubst:</code> after the double opening braces without intervening spaces like in the examples: <code>{{subst:FULLPAGENAME}}</code> and <code>{{safesubst:FULLPAGENAME}}</code>. The code <code>safesubst:</code> is useful in multilevel substitution, see <a href="#Multilevel_substitution">below</a>. </p><p>The result (in the form of the difference with the saved wikitext) can be seen before (or without) saving by pressing "Show changes". However, if the text covers more than one paragraph this diff page is not very suitable for copying the result (e.g. for stepwise substitution without saving every step), because of plus signs in the margin. </p> <meta property="mw:PageProp/toc"/> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="Applications" data-mw-thread-id="h-Applications"><span data-mw-comment-start="" id="h-Applications"></span>Applications<span data-mw-comment-end="h-Applications"></span></h2><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-Applications","replies":[]}}--></div> <p>Substitution of a template: </p> <ul><li>Make a <a href="https://en.wikipedia.org/wiki/render" class="extiw" title="w:render">rendered</a> page independent of the template: <ul><li>The rendered page does not change when the template is edited.</li> <li>The page can be copied to another MediaWiki wiki without copying the template.</li></ul></li> <li>Make page rendering easier and therefore faster for the server.</li> <li>Analyse and demonstrate the working of templates. However, in some cases substitution works differently.</li> <li>Make the correspondence between wikitext and rendered page easier to understand (this may apply, the opposite may also apply).</li></ul> <p>Substitution of a time-dependent variable: </p> <ul><li>Make a rendered page independent of the time.</li></ul> <p>Substitution of a page-dependent variable: </p> <ul><li>Make a rendered page independent of renaming of the page and of copying the wikitext to another page (the opposite applies if the variable PAGENAME is used in a no-include part of the page to include the page itself).</li></ul> <p>Some MediaWiki extensions have the restriction that if they are used in a template with parameters, they only work if the template is substituted. </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="Overview" data-mw-thread-id="h-Overview"><span data-mw-comment-start="" id="h-Overview"></span>Overview<span data-mw-comment-end="h-Overview"></span></h2><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-Overview","replies":[]}}--></div> <p>For the discussion of <b>substitution</b>, an <i>"ordinary template"</i> is the page that is referred to by either in the pattern {{subst:<i>pagename</i><small> </small>}} (for pages in the template namespace) or {{subst:<i>fullpagename</i><small> </small>}} (for pages in other namespaces). A <i>"predefined template"</i> is a <a href="/wiki/Special:MyLanguage/Help:variable" title="Special:MyLanguage/Help:variable">variable</a> or <a href="/wiki/Special:MyLanguage/Help:parser_function" title="Special:MyLanguage/Help:parser function">parser function</a> that is similarly substituted. </p><p>Substitution is a separate process that is performed before expansion of any non-substituted templates, variables, parser functions, or parameters. </p><p>A substitution call can have other substitution calls embedded in it. Similarly a substitution's substituted template can contain other substitution calls. Substitutions in the expression for the name of the template or parser function, in the parameter definitions of the substituted template or parser function and in the body of the substituted template are done first. </p><p>Since expansion is done later, any expression used in a substitution that happens to contain pairs of double braces, will have the braces treated as plain text. Thus during substitution there can be a parameter name with braces in the substitution call (e.g. <code>{{subst:foo|a{{bc}}d=...}}</code>) that matches a parameter with the same name in the template body (e.g. <code>{{{a{{bc}}d}}}</code>). </p><p>If one attempts to apply substitution to a non-existing template etc. there is no substitution, the "subst:" prefix is kept in the wikitext. </p><p>After the substitution process, expansion of templates etc. and other processing of the resulting wikitext works as usual. Because substitution is over, this cannot undo a mismatch of parameter names that occurred during substitution (see also the section "<a href="#Partial_substitution">Partial substitution</a>" below). </p><p>Substitution is only possible if the following has been fully evaluated: </p> <ul><li>the name of the template, variable, or parser function</li> <li>in the case of a template: the parameter names in the template call and in the template itself</li> <li>in the case of #if, #ifexpr, #ifexist and #iferror, the parameter after the colon</li> <li>in the case of #ifeq, the parameter after the colon and the next one</li> <li>in the case of #switch, the parameter after the colon and the expressions to the left of the equals signs</li></ul> <p>Since, as said, substitution is done before other expansion, the abovementioned required evaluation has not taken place if the expressions involve non-substituted expansion. </p><p>Also in the case of other parser functions than mentioned, a not fully evaluated parameter after the colon causes the parser function to be applied to the wikitext with braces and not the expanded wikitext, affecting the result. </p><p>Examples: </p> <ul><li>{{subst:Help:L{{tc}}k}} using <a href="/wiki/Template:Tc" title="Template:Tc">Template:tc</a>, does not do substitution, because Help:L{{tc}}k is not an existing page, although Help:L{{tc}}k is rendered as Help:Link. Thus the resulting wikitext is the same as the original wikitext and rendered as {{subst:Help:Link}}.</li> <li>{{#if:{{void|abc}}|yes|no}} (using <a href="/wiki/Template:Void" title="Template:Void">Template:void</a>) is rendered as "no", and so {{subst:#if:{{subst:void|abc}}|yes|no}} similarly gives the wikitext "no". On the other hand, {{subst:#if:{{void|abc}}|yes|no}} gives the wikitext "yes", because <a href="/wiki/Template:Void" title="Template:Void">Template:void</a> is not resolved until after substitution.</li></ul> <p>In principle the wikitext resulting from full substitution is, immediately after that, rendered the same as the wikitext with ordinary inclusion. </p><p>Note however that on substitution of a parser function, an undefined parameter with default, used in a parameter value, is not replaced by the <a href="https://en.wikipedia.org/wiki/Help:Parameter_default" class="extiw" title="w:Help:Parameter default">default</a> (in English Wikipedia), and is for example not allowed in the numerical expression evaluated on substitution of #expr: </p> <dl><dd><ul><li>{{#expr:2*{{{p|3}}}}} gives 6, while {{subst:#expr:2*{{{p|3}}}}} gives: <strong class="error">Expression error: unrecognised punctuation character "{"</strong></li></ul></dd></dl> <p>On substitution of a template that contains this, {{{p|3}}} is either replaced by the value of {{{p}}} or by 3, so then there is no complication. </p><p>{{ {{t6}} }} using <a href="/wiki/Template:T6" title="Template:T6">Template:t6</a> containing "<code><span style="background-color:#c8f0ff; padding:0 3px 2px 3px;">t2demo|a<noinclude>[[Category:Demo templates]]</noinclude></span></code>" is rendered as {{ t2demo|a }}. {{subst:{{subst:t6}} }} gives the wikitext {{subst:t2demo|a }} rendered the same as the wikitext, and on the next edit/save changed into start-a -middle-{{{2}}}-end. {{ {{subst:t6}} }} gives the wikitext {{ t2demo|a }}, rendered as start-a -middle-{{{2}}}-end. This is because, both without substitution and in the case of full substitution, the pipe characters in template calls, excluding those inside inner template calls, template parameters, links, and image tags, determine the separation of parameter definitions from each other and from the template name. This separation does not depend on possible extra pipe characters in the expanded form of the template name and parameter definitions. However, if after substitution of an inner template the pipe character is in the outer template call it is one like any other and plays its part in determining the separation. In other words, parsing is done first once for substitution, and then once for rendering, but in both cases not an extra time in between. In the case of substitution of the inner template only, two subsequent parsings are effective. </p><p>When substituting a template containing {{{p|q}}} (a parameter tag with default) this results in the value of p if it is defined, and otherwise in q. For example, using <a href="https://en.wikipedia.org/wiki/Template:Timc" class="extiw" title="w:Template:Timc">{{timc|t pd}}</a> (in English Wikipedia), {{subst:t pd}} gives the wikitext 2. If a page substitutes itself (e.g. in the noinclude-part of a template page) it substitutes the old version. </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="Usage_considerations" data-mw-thread-id="h-Usage_considerations"><span data-mw-comment-start="" id="h-Usage_considerations"></span>Usage considerations<span data-mw-comment-end="h-Usage_considerations"></span></h2><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-Usage_considerations","replies":["h-Ordinary_templates-Usage_considerations","h-Predefined_templates-Usage_considerations"]}}--></div> <p>As mentioned, a change of an ordinary template after substitution does not affect the page in which it was substituted, and a substituted variable depending on time no longer depends on time, etc. However, a substitution of e.g. {{#expr:2*3}} does not affect rendering at all. </p><p>The relationship between wikitext of a page and its rendering can become easier to understand after substitution, because one has all wikitext together, and parameter substitutions have been performed. </p><p>It can also become more complex. Separately focusing on understanding a template call and understanding the template content can be easier. Wikitext after substitution is often more complex than when the required wikitext would have been written directly. </p><p>Unlike a template call (if one knows about templates), wikitext after substitution does not show how one can produce a similar result. The wikitext can be long and complicated, and therefore cumbersome to <i>write</i> directly, or it can be simple, e.g. a number resulting from a computation, but cumbersome to <i>find</i> directly. When studying the wikitext of a page one may think that this wikitext is what one is supposed to write and find directly to get the result, even in cases where that would be very impractical. </p><p>In such cases documentation of the template call is useful. Just like in computer programming we change the <a href="https://en.wikipedia.org/wiki/source_code" class="extiw" title="w:source code">source code</a> and/or the data to produce new results, and we do not directly change the <a href="https://en.wikipedia.org/wiki/object_file" class="extiw" title="w:object file">object file</a>, here we would change the template calls and/or the templates, instead of changing the wikitext resulting from substitution directly. </p> <div class="mw-heading mw-heading3"><h3 id="Ordinary_templates" data-mw-thread-id="h-Ordinary_templates-Usage_considerations"><span data-mw-comment-start="" id="h-Ordinary_templates-Usage_considerations"></span>Ordinary templates<span data-mw-comment-end="h-Ordinary_templates-Usage_considerations"></span></h3></div> <p>In the case of substituting an ordinary template, the template tag is replaced by the wikitext of the template, with the parameter values substituted for the parameters. </p> <dl><dt>Example: <a href="https://meta.wikimedia.org/wiki/Template:t2" class="extiw" title="m:Template:t2">m:Template:t2</a>, containing</dt> <dd> <dl><dd><code>start-{{{1}}}-middle-{{{2}}}-end</code></dd></dl></dd> <dd>and called as <code>{{subst:t2|[[a]]|{{tc}}}}</code> (see {{<a href="/wiki/Special:MyLanguage/Template:tc" title="Special:MyLanguage/Template:tc">Tc</a><span style="display:none"><a href="/wiki/Template:Tc" title="Template:Tc"> </a></span>}}) gives the wikitext: <dl><dd><code>start-[[a]]-middle-{{tc}}-end</code>, rendering as</dd> <dd>start-<a href="/w/index.php?title=A&action=edit&redlink=1" class="new" title="A (page does not exist)">a</a>-middle-in-end.</dd></dl></dd></dl> <p>Substitution removes the noinclude parts and the includeonly tags. </p><p>Parameters: </p> <ul><li>A substitution with p=r replaces {{{p}}} and {{{p|q}}} by <code>r</code>. This includes the cases that <code>r</code> is of the form {{{s}}} or {{{s|t}}}.</li> <li>A substitution with undefined <code>p</code> preserves <code>{{{p}}}</code> and replaces {{{p|q}}} by the <a href="https://en.wikipedia.org/wiki/Help:Parameter_default" class="extiw" title="w:Help:Parameter default">default</a> <code>q</code> (in English Wikipedia).</li></ul> <p>With <code>subst:</code> the replacement of a template tag by wikitext does not work recursively. For full recursive substitution use <a href="/wiki/Special:ExpandTemplates" title="Special:ExpandTemplates">Special:ExpandTemplates</a>. See also <a href="https://bugzilla.wikimedia.org/2777" class="extiw" title="mediazilla:2777">substall</a>, and <a href="#Multilevel_substitution">multilevel substitution</a> below. </p><p>Stepwise substitution of templates including other templates including more templates etc. can be useful for analyzing and documenting the behaviour of complex templates. </p><p>However, after a substitution a page may render differently, e.g. if templates produce braces, pipes, and/or equals signs which after substitution determine expansion of other templates, but without substitution are treated as plain text. </p><p>In the absence of parameters, template substitution can be compared with copying the wikitext, or the rendering of a previewed or saved {{<small> </small><code><a href="/wiki/Special:MyLanguage/Help:Magic_words" title="Special:MyLanguage/Help:Magic words">msgnw:</a></code><i>pagename</i><small> </small>}} inclusion. However, template substitution excludes <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">noinclude</span><span class="p">></span></code> parts, removes <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r4673781"><code class="mw-highlight nowrap"><span class="p"><</span><span class="nt">includeonly</span><span class="p">></span></code> tags, and replaces undefined parameters with defaults by those defaults. </p> <div class="mw-heading mw-heading3"><h3 id="Predefined_templates" data-mw-thread-id="h-Predefined_templates-Usage_considerations"><span data-mw-comment-start="" id="h-Predefined_templates-Usage_considerations"></span>Predefined templates<span data-mw-comment-end="h-Predefined_templates-Usage_considerations"></span></h3></div> <p>In the case of substituting a predefined template, without parameters depending on other templates, the tag is replaced by the result. </p> <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-info"><code>subst:</code> has to be added directly in front of the predefined template name <b>without intervening spaces.</b></div> <p>Applying subst to a variable works like applying it to a template. E.g. a timestamp: </p> <dl><dt>{{subst:CURRENTYEAR}}-{{subst:CURRENTMONTH}}-{{subst:CURRENTDAY}} T {{subst:CURRENTTIME}} [[w:UTC|]]</dt> <dd></dd></dl> <p>may give the wikitext </p> <dl><dd>2010-04-10 T 06:30 [[w:UTC|UTC]]</dd></dl> <p>rendered as </p> <dl><dd>2010-04-10 T 06:30 <a href="https://en.wikipedia.org/wiki/UTC" class="extiw" title="w:UTC">UTC</a></dd></dl> <p>In the case of substituting a predefined template with a parameter depending on another template, that has to be substituted too, with a separate <code>subst:</code> modifier, otherwise the result is undefined. </p> <ul><li><code>{{subst:UC:{{subst:tc}}}}</code> - gives IN, the same wikitext as {{UC:{{tc}}}} is expanded to; <code>UC:</code> is applied to the output "<b>in</b>" of <a href="https://meta.wikimedia.org/wiki/Template:Tc" class="extiw" title="m:Template:Tc">Tc</a>.</li> <li><code>{{subst:ns:{{subst:#expr:2*3}}}}</code> - gives File.</li> <li><code>{{ns:{{subst:#expr:2*3}}}}</code> - gives wikitext {{ns:6}} rendered as File.</li> <li><code>{{subst:t1|{{subst:NAMESPACE}}}}</code> - gives the wikitext startHelpend (see {{<a href="/wiki/Special:MyLanguage/Template:t1" title="Special:MyLanguage/Template:t1">T1</a><span style="display:none"><a href="/wiki/Template:T1" class="mw-redirect" title="Template:T1"> </a></span>}})</li> <li><code>{{subst:t1|{{subst:#expr:3*4}}}}</code> - gives the wikitext start12end</li> <li><code>{{subst:t1|{{subst:uc:AbCdEf}}}}</code> - gives the wikitext startABCDEFend</li> <li><code>{{subst:#expr:{{subst:3X|11*}}1}}</code> - gives the wikitext 1331</li> <li><code>{{subst:UC:{{subst:3X|abc}}}}</code> - gives the wikitext ABCABCABC</li> <li><code>{{subst:LC:{{subst:#expr:1/100000}}}}</code> - gives the wikitext 1e-05</li> <li><code>{{subst:#expr:2*{{subst:CURRENTDAY}}}}</code> - gives (at the time of writing) the wikitext 30</li> <li><code>{{subst:UC:{{subst:CURRENTDAYNAME}}}}</code> - gives (at the time of writing) the wikitext THURSDAY</li></ul> <p>However: </p> <ol><li><code>{{subst:UC:{{tc}}}}</code> - gives the wikitext <code>{{TC}}</code> rendered as <a href="/w/index.php?title=Template:TC&action=edit&redlink=1" class="new" title="Template:TC (page does not exist)">Template:TC</a>.</li> <li><code>{{subst:ns:{{#expr:2*3}}}}</code> - stays {{subst:ns:{{#expr:2*3}}}}, rendered as {{subst:ns:6}}.</li></ol> <p>As mentioned before, on substitution, all calls without substitution of templates, variables, and parser functions are treated as plain text. As a result substitution of the outer <code>x:</code> in a nested {{<small> </small><code>x:<b>...</b></code>{{<small> </small><code>y:<b>...</b></code>}}<small> </small>}} often is only suitable if all inner <code>y:</code> are also substituted. </p><p>In the case of substitution of a predefined template, if the expression for one of its parameters contains {{{p|3}}} with undefined <code>p</code>, this code reduces to 3. However, on the page itself, {{{p|3}}} is treated as such, not as 3. </p><p>Examples: </p> <ul><li><code>{{#expr:2*{{{p}}}}}</code> → <code><strong class="error">Expression error: Unrecognized punctuation character "{".</strong></code></li> <li><code>{{#expr:2*{{{p|3}}}}}</code> → <code>6</code></li> <li><code>{{subst:#expr:2*{{{p|3}}}}}</code> → <strong class="error">Expression error: Unrecognized punctuation character "{".</strong></li> <li>substituting a template containing {{<includeonly>subst:</includeonly>#expr:2*{{{p|3}}}}} gives 6 if <code>p</code> is not assigned a value, and twice the number <code>p</code> if it <i>is</i> assigned a value.</li> <li>the same result can be obtained from a template containing {{{{{subst}}}#expr:2*{{{p|3}}}}}, if the substitution call has a parameter of "<code>subst=subst:</code>".</li></ul> <p>Compare: </p> <ul><li><code>{{uc:2*{{{p}}}}}</code> → <code>2*{{{P}}}</code></li> <li><code>{{uc:2*{{{p|q}}}}}</code> → <code>2*Q</code></li> <li><code>{{subst:uc:2*{{{p|q}}}}}</code> → the wikitext 2*{{{P|Q}}} rendered as 2*Q</li></ul> <p>and also (from above): </p> <ul><li><code>{{subst:UC:{{subst:tc}}}}</code> - gives IN, just like {{UC:{{tc}}}} does; <a href="/wiki/Special:MyLanguage/Help:Parser_function" title="Special:MyLanguage/Help:Parser function">UC</a><span style="display:none"><a href="/wiki/Help:Parser_function" class="mw-redirect" title="Help:Parser function"> </a></span> is applied to the output "<b>in</b>" of <a href="https://meta.wikimedia.org/wiki/Template:Tc" class="extiw" title="m:Template:Tc">Tc</a>.</li> <li><code>{{subst:UC:{{tc}}}}</code> - gives the wikitext <code>{{TC}}</code> rendered as <a href="/w/index.php?title=Template:TC&action=edit&redlink=1" class="new" title="Template:TC (page does not exist)">Template:TC</a>.</li></ul> <p>In the substitution of <code>UC</code>, the inclusion tag {{tc}} is treated as string just like {{{p|q}}}. </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="Partial_substitution" data-mw-thread-id="h-Partial_substitution"><span data-mw-comment-start="" id="h-Partial_substitution"></span>Partial substitution<span data-mw-comment-end="h-Partial_substitution"></span></h2><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-Partial_substitution","replies":[]}}--></div> <p>Inside an ordinary template one can apply substitution to an ordinary template call containing a parameter, to replace it by the direct wikitext containing the parameter. It amounts to automatically merging the two templates (creating a "composite template" like a <a href="https://en.wikipedia.org/wiki/Function_composition" class="extiw" title="w:Function composition">composite function</a>). It is not possible if the inner and/or outer template is predefined. (However, manually merging e.g. a call of #expr inside another one is useful for increasing the accuracy of the result by avoiding intermediate rounding to 12 digits.) </p><p>This way one can dispense with the optional substitution technique described below, and apply substitution of the resulting outer template by simply using <code>subst:</code> (unless there are more nesting levels). </p><p>Example: </p> <ul><li><code>{{subst:t}}</code> - gives the wikitext <code>start-{{{1|pqr}}}-end</code>, just that of <a href="https://meta.wikimedia.org/wiki/Template:t" class="extiw" title="m:Template:t">m:Template:t</a>, without noinclude parts and includeonly tags</li> <li><code>{{subst:t|a{{{p|q}}}b}}</code> - gives the wikitext <code>start-a{{{p|q}}}b-end</code></li></ul> <p>Examples with double substitution: </p> <ul><li><code>{{subst:3X|{{subst:t}}}}</code> - gives the wikitext <code>start-{{{1|pqr}}}-endstart-{{{1|pqr}}}-endstart-{{{1|pqr}}}-endstart-{{{1|q}}}-end</code></li> <li><code>{{subst:3X|{{subst:t|{{{1|q}}}}}}}</code> - gives the wikitext <code>start-{{{1|q}}}-endstart-{{{1|q}}}-endstart-{{{1|q}}}-end</code></li></ul> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="Multilevel_substitution" data-mw-thread-id="h-Multilevel_substitution"><span data-mw-comment-start="" id="h-Multilevel_substitution"></span>Multilevel substitution<span data-mw-comment-end="h-Multilevel_substitution"></span></h2><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-Multilevel_substitution","replies":[]}}--></div> <p>When substituting a template it may be desirable to carry out a substitution inside the template too. This can be done with <code>safesubst:</code> in the template. To prevent premature substitution (i.e., when the template is saved), it is possible to append the <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r4673781"><code class="mw-highlight nowrap"><span class="p"><</span><span class="nt">noinclude</span> <span class="p">/></span></code> directive after the substitution directive – i.e. <code>safesubst:<noinclude /></code>. Another solution is to use the default value of an unused parameter. Often the empty string works, i.e. <code>{{{|safesubst:}}}</code>, however it is sometimes used by modules that call templates or for inserting comments. </p><p>The difference with <code>subst:<noinclude /></code> is that <code>safesubst:<noinclude /></code>, evaluating to <code>safesubst:</code> not only allows multilevel substitution but also multilevel transclusion, because on transclusion it is ignored. To make the template such that it allows the choice between these two options as well as one-level substitution (and more choices if more templates, variables, and/or parser functions are involved) one or more parameters are needed, see below. </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="Multilevel_substitution_with_independent_control_of_each_substitution_separately" data-mw-thread-id="h-Multilevel_substitution_with_independent_control_of_each_substitution_separately"><span data-mw-comment-start="" id="h-Multilevel_substitution_with_independent_control_of_each_substitution_separately"></span>Multilevel substitution with independent control of each substitution separately<span data-mw-comment-end="h-Multilevel_substitution_with_independent_control_of_each_substitution_separately"></span></h2><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-Multilevel_substitution_with_independent_control_of_each_substitution_separately","replies":["h-Partial_substitution_2-Multilevel_substitution_with_independent_control_of_each_substitution_separately","h-Composite_operations-Multilevel_substitution_with_independent_control_of_each_substitution_separately"]}}--></div> <p>A parameter subst (or more, each with its own name) can be used with <code>safesubst:</code> and the empty string as possible values. Thus we can for example control whether an inner template is substituted too when the outer template is substituted. Either possibility can be made the default. </p><p>Inner templates with parameters may control further inner substitutions in the same way; these parameters may depend on the substitution parameter controlling the substitution of the inner template, since if that is not substituted, inner substitutions within that template are not possible. </p><p>Similarly, if there are multiple templates, variables, and/or parser functions in the inner template(s) we can control substitution of all, either independently by using different parameters, or with some or all using the same parameter. </p><p>For example, if template <code>T</code> uses parameter <code>subst1</code>: </p> <ul><li>with the empty string as default, <code>T</code> calls inner templates and parser functions prefixing their names with {{{subst1|}}}; for calling <code>T</code> we can use: <ul><li>{{t|..}} - no substitution</li> <li>{{subst:t|..}} - one-level substitution</li> <li>{{subst:t|subst1=subst:|..}} - two-level substitution</li> <li>{{subst:t|subst1=safesubst:|..}} - ditto</li></ul></li> <li>with default "safesubst:", <code>T</code> calls inner templates and parser functions prefixing their names with {{{subst1|safesubst:}}}; for calling <code>T</code> we can use: <ul><li>{{t|..}} - no substitution</li> <li>{{subst:t|subst1=|..}} - one-level substitution</li> <li>{{subst:t|..}} - two-level substitution</li></ul></li></ul> <p>To transfer the choice of substituting or not to templates and parser functions called inside the inner templates of <code>T</code>, we can add to the call of these inner templates something of the form subst2={{{subst1|}}} or subst2={{{subst1|safesubst:}}}, respectively (<a href="/wiki/Special:MyLanguage/Help:variable" title="Special:MyLanguage/Help:variable">variables</a><span style="display:none"><a href="/wiki/Help:Variable" class="mw-redirect" title="Help:Variable"> </a></span> and <a href="/wiki/Special:MyLanguage/Help:parser_function" title="Special:MyLanguage/Help:parser function">parser functions</a><span style="display:none"><a href="/wiki/Help:Parser_function" class="mw-redirect" title="Help:Parser function"> </a></span> don't get the additional parameter). </p> <div class="mw-heading mw-heading3"><h3 id="Partial_substitution_2" data-mw-thread-id="h-Partial_substitution_2-Multilevel_substitution_with_independent_control_of_each_substitution_separately"><span data-mw-comment-start="" id="h-Partial_substitution_2-Multilevel_substitution_with_independent_control_of_each_substitution_separately"></span>Partial substitution<span data-mw-comment-end="h-Partial_substitution_2-Multilevel_substitution_with_independent_control_of_each_substitution_separately"></span></h3></div> <p>Using a template prepared for optional <code>subst=subst:</code> only with ordinary substitution, without specifying parameter values, allows to insert its code into another template, like copy and paste, but all <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r4673781"><code class="mw-highlight nowrap"><span class="p"><</span><span class="nt">noinclude</span><span class="p">></span></code> parts and <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r4673781"><code class="mw-highlight nowrap"><span class="p"><</span><span class="nt">includeonly</span><span class="p">></span></code> keywords automatically stripped. Executing inserted code instead of calling it may be more efficient for the server. </p><p>A typical example for this technique is expanding, within another template, a template used as test expression in a <a href="https://meta.wikimedia.org/wiki/ParserFunctions#.23switch:" class="extiw" title="m:ParserFunctions">#switch:</a> like <a href="https://meta.wikimedia.org/wiki/Template:len" class="extiw" title="m:Template:len">m:Template:len</a>: </p> <ol><li>Development code:<br/><code>{{#switch: {{len|<i>parameter tag</i>}}|0=<i>case 0 etc.</i>}}</code></li> <li>Standard solution:<br/><code>{{{{{subst|}}}#switch: {{{{{subst|}}}len|<i>parameter tag</i>|subst={{{subst|}}}}}|0=<i>case 0 etc.</i>}}</code></li> <li>Better solution: create template code by applying substitution using this wikitext:<br/><code>{{{{{subst|}}}#switch: {{subst:len|<i>parameter tag</i>}}|0=<i>case 0 etc.</i>}}</code></li></ol> <p><a href="https://meta.wikimedia.org/wiki/Template:len" class="extiw" title="m:Template:len">m:Template:len</a> is prepared for optional substitution, therefore both solutions work, but the latter solution substituting its code is simpler and more efficient. </p><p>See <a href="https://meta.wikimedia.org/wiki/Template:csn" class="extiw" title="m:Template:csn">m:Template:csn</a> and <a href="https://meta.wikimedia.org/wiki/Template:lz12" class="extiw" title="m:Template:lz12">m:Template:lz12</a> for cases where <code>Template:len</code> was substituted in this way. </p><p>If a template uses a parameter whose name is an expression containing a template or parser function, and the template is called with a corresponding parameter definition (in terms of the final name of the parameter) it expands properly only if at the time of expansion of the template the expression for the name of the parameter is or has been evaluated. Thus if the template is substituted without substituting the expression for the parameter name, the parameter definition is "lost", so the parameter becomes undefined. Therefore in such a case no substitution can give the same rendered result as full substitution, while partial substitution gives a different result. See e.g. <a href="https://meta.wikimedia.org/wiki/Template:ts1" class="extiw" title="m:Template:ts1">m:Template:ts1</a>. </p> <div class="mw-heading mw-heading3"><h3 id="Composite_operations" data-mw-thread-id="h-Composite_operations-Multilevel_substitution_with_independent_control_of_each_substitution_separately"><span data-mw-comment-start="" id="h-Composite_operations-Multilevel_substitution_with_independent_control_of_each_substitution_separately"></span>Composite operations<span data-mw-comment-end="h-Composite_operations-Multilevel_substitution_with_independent_control_of_each_substitution_separately"></span></h3></div> <p>By <code>{{A|{{B|p}}}}</code> a template <code>A</code> is called with, as parameter, a call of template <code>B</code> with a parameter <code>p</code>. We could integrate such template calls to a single call <code>{{C|p}}</code> of a "<a href="https://en.wikipedia.org/wiki/Function_composition" class="extiw" title="w:Function composition">composite template</a>" <code>C</code> with parameter <code>p</code>. </p> <dl><dt>The wikitext for template <code>C</code> would be <code>{{A|{{B|{{{1}}}}}}}</code>, or with optional substitution the following construct :</dt> <dt><big>{{<b><small> {{{subst</small><code>|</code><small>}}} </small></b>A|{{<b><small> {{{subst</small><code>|</code><small>}}} </small></b>B|{{{1}}}<b><small> |subst={{{subst</small><code>|</code><small>}}} </small></b>}}<b><small> |subst={{{subst</small><code>|</code><small>}}} </small></b>}}</big></dt> <dt>The <code>subst={{{subst|}}}</code> is only necessary for recursive substitution as explained above.</dt></dl> <p>Note that it is not useful to specify <code>{{subst|subst:}}</code> since in the substitution phase this tag does not reduce to the default <code>subst:</code>. </p><p>If <code>A</code> and/or <code>B</code> is predefined the construct is similar, but without <code>subst={{{subst|}}}</code> for that template. </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="includeonly" data-mw-thread-id="h-includeonly"><span data-mw-comment-start="" id="h-includeonly"></span>includeonly<span data-mw-comment-end="h-includeonly"></span></h2><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-includeonly","replies":[]}}--></div> <p>An alternative method to prevent premature substitution, known as <i>"includeonly subst magic"</i>, is with a pair of includeonly tags. Substitution is prevented by having the template call inside these tags. Substitution is also prevented by having one or both tags anywhere in the template call except inside a parameter definition. Thus the tag(s) can be before, inside, or after <code>safesubst:</code> or <code>subst:</code>, or inside or after the template name. The positions of the two tags only influence the rendering of the template page itself. </p><p>The form <code>{{<includeonly>safesubst:</includeonly>something}}</code> suggests that substitution is prevented by discarding <code>safesubst:</code> on the page itself, but actually substitution is prevented because the safesubst-syntax is disturbed by the tags. </p><p>It doesn't substitute <i>"something"</i> at the time of the creation of the relevant template, but has the desired effect when the template is substituted. </p><p>For examples see "preload" in <a href="/wiki/Special:MyLanguage/Extension:InputBox#Parameters" title="Special:MyLanguage/Extension:InputBox">Extension:InputBox</a><span style="display:none"><a href="/wiki/Extension:InputBox#Parameters" title="Extension:InputBox"> </a></span> and "substitution" in <a href="/wiki/Special:MyLanguage/Help:Magic_words#Transclusion_modifiers" title="Special:MyLanguage/Help:Magic words">Help:Magic words</a><span style="display:none"><a href="/wiki/Help:Magic_words#Transclusion_modifiers" title="Help:Magic words"> </a></span>. </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="Creating_a_page_which_applies_substitution_on_the_next_save" data-mw-thread-id="h-Creating_a_page_which_applies_substitution_on_the_next_save"><span data-mw-comment-start="" id="h-Creating_a_page_which_applies_substitution_on_the_next_save"></span>Creating a page which applies substitution on the next save<span data-mw-comment-end="h-Creating_a_page_which_applies_substitution_on_the_next_save"></span></h2><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-Creating_a_page_which_applies_substitution_on_the_next_save","replies":[]}}--></div> <p>See <a href="/wiki/Special:MyLanguage/Manual:Recursive_conversion_of_wikitext" title="Special:MyLanguage/Manual:Recursive conversion of wikitext">Manual:Recursive conversion of wikitext</a><span style="display:none"><a href="/wiki/Manual:Recursive_conversion_of_wikitext" title="Manual:Recursive conversion of wikitext"> </a></span>. </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="Forced_substitution" data-mw-thread-id="h-Forced_substitution"><span data-mw-comment-start="" id="h-Forced_substitution"></span>Forced substitution<span data-mw-comment-end="h-Forced_substitution"></span></h2><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-Forced_substitution","replies":[]}}--></div> <p>Some templates deliberately refuse to work without substitution, for an example see <a href="https://en.wikipedia.org/wiki/Template:en" class="extiw" title="w:Template:en">w:Template:en</a>. This technique is essential for templates like <a href="https://en.wikipedia.org/wiki/Template:en" class="extiw" title="w:Template:en">w:Template:en</a> producing some kind of timestamp, e.g. adding pages to dated categories. </p> <dl><dt>The following code in any template <code>T</code> outputs a warning unless recursive substitution with <code>subst=subst:</code> is in effect:</dt> <dd><code>{{{{{subst|}}}ifdef|{{{{{subst|subst:}}}ns:0}}|'''Warning'''}}</code>. <ol><li>Output for <code>{{T}}</code> or <code>{{subst:T}}</code> - <b>Warning</b></li> <li>Output for <code>{{T|subst=subst:}}</code> - <code><a href="/w/index.php?title=Template:Ifdef&action=edit&redlink=1" class="new" title="Template:Ifdef (page does not exist)">Template:Ifdef</a></code></li> <li>Output for <code>{{subst:T|subst=subst:}}</code> - nothing (no remaining wikitext)</li></ol></dd></dl> <dl><dt>This is a rare case where replacing <code><a href="https://meta.wikimedia.org/wiki/Template:ifdef" class="extiw" title="m:Template:ifdef">ifdef</a></code> by <code>#if:</code> doesn't work directly.</dt></dl> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="Substitution_of_part_of_the_parameters" data-mw-thread-id="h-Substitution_of_part_of_the_parameters"><span data-mw-comment-start="" id="h-Substitution_of_part_of_the_parameters"></span>Substitution of part of the parameters<span data-mw-comment-end="h-Substitution_of_part_of_the_parameters"></span></h2><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-Substitution_of_part_of_the_parameters","replies":[]}}--></div> <p>Let template <code>Feelings</code> use parameters 1 and 2. Consider creating a template Emotions with one parameter 1, corresponding to <code>Feelings</code>, with a given value <code>love</code> of parameter 2. Compare <code>{{Feelings|2=love}}</code> and <code>{{Feelings|1={{{1}}}|2=love}}</code>. They look the same on the template page, see e.g. <code><a href="https://meta.wikimedia.org/wiki/Template:t_ps" class="extiw" title="m:Template:t ps">m:Template:t ps</a></code>, but the first does not work because <code>{{{1}}}</code> is treated as text, not as parameter. </p><p>However, with substitution (using <code>subst:</code> or <a href="/wiki/Special:ExpandTemplates" title="Special:ExpandTemplates">Special:Expandtemplates</a>) the resulting wikitext is the same, without distinction between a text {{{1}}} and a parameter, it is a parameter anyway, so <code>1={{{1}}}</code> is not needed. </p><p>If <code>Feelings</code> contains e.g. <code>#expr</code> with an expression containing both parameters the same applies, except that we can only substitute the highest level (<code>Feelings</code>), not the parser function, so we cannot use <code>Special:Expandtemplates</code>. </p><p>In general, substituting a parameter and applying a template or parser function sometimes gives the same result as substituting the template or parser function with the triple-braced parameter code and then substituting the parameter. </p><p>Without defaults (all rendered the same in one-step substitution as without substitution): </p><p>Examples with equality: </p> <ul><li><code>Feelings</code> template containing <code>With {{{1}}} one can {{{2}}}</code> <ul><li>When substituted with <code>1=love</code>, <code>2=help</code>, it gives <code>With love one can help</code>.</li> <li>When substituted with <code>2=help</code>, it gives <code>With {{{1}}} one can help</code>. This itself, when substituted with <code>1=compassion</code>, it gives <code>With compassion one can help</code>.</li></ul></li> <li>Two-level substitution of a template containing <code>{{#if:{{{4}}}|{{{3}}}p}}</code>. <ul><li>When substituted with <code>3=u</code>, <code>4=v</code>, it gives <code>up</code>.</li> <li>When substituted with <code>4=v</code>, it gives <code>{{{3}}}p</code>. This itself, when substituted with <code>3=u</code>, it gives <code>up</code>.</li></ul></li></ul> <p>Examples without equality: </p> <ul><li>Two-level substitution of a template containing <code>{{#if:{{{3}}}|{{{4}}}p}}</code> <ul><li>When substituted with <code>3=</code>, <code>4=v</code>, it gives the empty string.</li> <li>When substituted with <code>4=v</code>, it gives <code>vp</code>. This itself, when substituted with <code>3=u</code>, it remains <code>vp</code>.</li></ul></li> <li>Two-level substitution of a template containing <code>{{#if:{{{2}}}|{{{1}}}p}}</code> <ul><li>When substituted with <code>1=u</code>, <code>2=v</code>, it gives <code>up</code>.</li> <li>When substituted with <code>2=v</code>, it gives <code>{{{1}}}pp</code> (the bug). This itself, when substituted with <code>3=u</code>, it gives <code>upp</code>.</li></ul></li> <li>Two-level substitution of a template containing <code>{{#expr:{{{1}}}*{{{2}}}}}</code> <ul><li>When substituted with <code>1=7</code>, <code>2=8</code>, it gives <code>56</code>.</li> <li>When substituted with <code>2=8</code>, it gives <strong class="error">Expression error: Unrecognised punctuation character "{"</strong>. This itself, when substituted with <code>1=7</code>, it remains the same.</li></ul></li></ul> <p>Thus without equality we may or may not get an error message. </p><p>One example shows that substitution of one parameter can be affected by the bug mentioned above. However, we can then replace e.g. <code>{{{1}}}</code> by <code>{{{1{{{{{substvoid|}}}void}}}}}</code> and do full substitution, except that <code>substvoid</code> is undefined, preventing the bug. The result works already correctly with transclusion. Subsequently it can be substituted with <code>substvoid=subst:</code> so that we get the plain <code>{{{1}}}</code>. </p><p>With defaults: </p><p>Rendered the same as without substitution: </p> <ul><li>Two-level substitution of a template containing <code>With {{{1|love}}} one can {{{2}}}</code> with <code>2=help</code> gives <code>With {{{1|love}}} one can help</code>.</li> <li>Two-level substitution of a template containing <code>{{#if:{{{4}}}|{{{3|d}}}p}}</code> with <code>4=v</code> gives <code>dp</code>.</li></ul> <p>Not rendered the same as without substitution: </p> <ul><li>Two-level substitution of a template containing <code>{{#if:{{{3|}}}|{{{4}}}p}}</code> with <code>4=v</code> gives <code>vp</code>.</li> <li>Two-level substitution of a template containing <code>{{#if:{{{2}}}|{{{1|d}}}p}}</code> with <code>2=v</code> gives <code>dpp</code> (the bug).</li> <li>Two-level substitution of a template containing <code>{{#expr:{{{1|6}}}*{{{2}}}}}</code> with <code>2=8</code> gives: <strong class="error">Expression error: Unrecognised punctuation character "{"</strong></li></ul> <p>After substitution with the parameter definition: </p> <ul><li><code>{{subst:#if:{{{3|}}}|vp}}</code> → <code>vp</code></li> <li><code>{{subst:#if:v|{{{1|d}}}p}}</code> → <code>dpp</code> (the bug)</li> <li><code>{{subst:#expr:{{{1|6}}}*8}}</code> → <strong class="error">Expression error: Unrecognised punctuation character "{"</strong></li></ul> <p>Rewritten: </p> <ul><li><code>{{subst:#if:{{subst:#ifeq:{{{3|+}}}|{{{3|-}}}|vp}}}}</code> → the empty string</li> <li><code>{{subst:#if:v|{{subst:#ifeq:{{{1|+}}}|{{{1|-}}}|{{{1}}}|d}}p}}</code> → <code>dp</code></li> <li><code>{{subst:#expr:{{subst:#ifeq:{{{1|+}}}|{{{1|-}}}|{{{1}}}|6}}*8}}</code> → <code>48</code></li></ul> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="Limitations" data-mw-thread-id="h-Limitations"><span data-mw-comment-start="" id="h-Limitations"></span>Limitations<span data-mw-comment-end="h-Limitations"></span></h2><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-Limitations","replies":[]}}--></div> <p>Substitution is not available inside parser tags like <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>...<span class="p"></</span><span class="nt">ref</span><span class="p">></span></code> and <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r4673781"><code class="mw-highlight nowrap"><span class="p"><</span><span class="nt">gallery</span><span class="p">></span>...<span class="p"></</span><span class="nt">gallery</span><span class="p">></span></code>. If you write <code>{{subst:foo}}</code>, it is not substituted nor transcluded, but remains as-is. </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="Documenting_substitution" data-mw-thread-id="h-Documenting_substitution"><span data-mw-comment-start="" id="h-Documenting_substitution"></span>Documenting substitution<span data-mw-comment-end="h-Documenting_substitution"></span></h2><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-Documenting_substitution","replies":[]}}--></div> <p>Usage of a template through <code>subst:</code> does not automatically show up in page histories. Therefore providing the line of wikitext containing "subst:" in the <a href="/wiki/Special:MyLanguage/Help:Edit_summary" title="Special:MyLanguage/Help:Edit summary">edit summary</a> is especially useful. </p><p>Also pages with a substituted template do not show up in backlinks, and the template does not appear in the list of transcluded templates on the edit page. The template could add pages to a category to track substitutions, but listing this category on a page may clutter the list of content-based categories the page is in. Also, comments outside noinclude tags are included in the wikitext. Thus a comment can be used to mention the template. It can even contain the values of the parameters, because substitution of parameters works even in comments. </p> <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:Substitution/tl;dr" title="Special:MyLanguage/Help:Substitution/tl;dr">Help:Substitution/tl;dr</a><span style="display:none"><a href="/wiki/Help:Substitution/tl;dr" title="Help:Substitution/tl;dr"> </a></span> – <a href="https://en.wiktionary.org/wiki/tl;dr" class="extiw" title="wikt:tl;dr">tl;dr</a></li> <li><a href="https://en.wikipedia.org/wiki/Help:Substitution#The_safesubst:_modifier" class="extiw" title="w:Help:Substitution">modifier</a></li> <li><a href="https://en.wikipedia.org/wiki/Wikipedia:Template_substitution" class="extiw" title="w:Wikipedia:Template substitution">w:Wikipedia:Template substitution</a> – partly technical, partly policy</li> <li><a href="https://phabricator.wikimedia.org/T4003" class="extiw" title="phabricator:T4003">Phabricator:T4003</a> – feature request to allow marking a template as being substituted without <code>subst:</code></li> <li>Templates containing a call to itself with <code>subst:</code> and producing a similar call with updated info, either replacing or adding to the previous info: <ul><li><a href="https://meta.wikimedia.org/wiki/Template:last_edit" class="extiw" title="m:Template:last edit">m:Template:last edit</a></li> <li><a href="https://meta.wikimedia.org/wiki/Template:page_history" class="extiw" title="m:Template:page history">m:Template:page history</a></li></ul></li> <li>The <a href="/wiki/Special:MyLanguage/Help:Links#Pipe_trick" title="Special:MyLanguage/Help:Links">pipe trick</a>, which behaves similarly to template substitution</li></ul> <!-- NewPP limit report Parsed by mw‐web.codfw.main‐7f7789979b‐56z2r Cached time: 20250213210624 Cache expiry: 2592000 Reduced expiry: false Complications: [show‐toc] DiscussionTools time usage: 0.022 seconds CPU time usage: 0.315 seconds Real time usage: 0.420 seconds Preprocessor visited node count: 3186/1000000 Post‐expand include size: 12930/2097152 bytes Template argument size: 2397/2097152 bytes Highest expansion depth: 13/100 Expensive parser function count: 10/500 Unstrip recursion depth: 0/20 Unstrip post‐expand size: 9595/5000000 bytes Lua time usage: 0.025/10.000 seconds Lua memory usage: 1144527/52428800 bytes Number of Wikibase entities loaded: 0/400 --> <!-- Transclusion expansion time report (%,ms,calls,template) 100.00% 141.433 1 -total 40.11% 56.734 9 Template:Ll 16.23% 22.951 1 Template:PD_Help_Page 15.58% 22.031 2 Template:Tl 13.88% 19.630 18 Template:Translatable 10.21% 14.437 7 Template:Tmpl 10.05% 14.210 2 Template:TNTN 9.20% 13.016 7 Template:Tag 8.64% 12.223 9 Template:Pagelang 7.97% 11.270 1 Template:Note --> <!-- Saved in parser cache with key mediawikiwiki:pcache:42730:|#|:idhash:canonical and timestamp 20250213210624 and revision id 7020264. 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?useformat=desktop&type=1x1&usesul3=0" 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:Substitution&oldid=7020264">https://www.mediawiki.org/w/index.php?title=Help:Substitution&oldid=7020264</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">Category</a>: <ul><li><a href="/wiki/Category:Templates" title="Category:Templates">Templates</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 13 February 2025, at 21:00.</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/">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:Substitution&mobileaction=toggle_view_mobile" 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" lang="en" 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"><picture><source media="(min-width: 500px)" srcset="/w/resources/assets/poweredby_mediawiki.svg" width="88" height="31"><img src="/w/resources/assets/mediawiki_compact.svg" alt="Powered by MediaWiki" width="25" height="25" loading="lazy"></picture></a></li> </ul> </footer> </div> </div> </div> <div class="vector-header-container vector-sticky-header-container"> <div id="vector-sticky-header" class="vector-sticky-header"> <div class="vector-sticky-header-start"> <div class="vector-sticky-header-icon-start vector-button-flush-left vector-button-flush-right" aria-hidden="true"> <button class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-sticky-header-search-toggle" tabindex="-1" data-event-name="ui.vector-sticky-search-form.icon"><span class="vector-icon mw-ui-icon-search mw-ui-icon-wikimedia-search"></span> <span>Search</span> </button> </div> <div role="search" class="vector-search-box-vue vector-search-box-show-thumbnail vector-search-box"> <div class="vector-typeahead-search-container"> <div class="cdx-typeahead-search cdx-typeahead-search--show-thumbnail"> <form action="/w/index.php" id="vector-sticky-search-form" class="cdx-search-input cdx-search-input--has-end-button"> <div 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.org"> <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> <div class="vector-sticky-header-context-bar"> <nav aria-label="Contents" class="vector-toc-landmark"> <div id="vector-sticky-header-toc" class="vector-dropdown mw-portlet mw-portlet-sticky-header-toc vector-sticky-header-toc vector-button-flush-left" > <input type="checkbox" id="vector-sticky-header-toc-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-sticky-header-toc" class="vector-dropdown-checkbox " aria-label="Toggle the table of contents" > <label id="vector-sticky-header-toc-label" for="vector-sticky-header-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-sticky-header-toc-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <div class="vector-sticky-header-context-bar-primary" aria-hidden="true" ><span class="mw-page-title-namespace">Help</span><span class="mw-page-title-separator">:</span><span class="mw-page-title-main">Substitution</span></div> </div> </div> <div class="vector-sticky-header-end" aria-hidden="true"> <div class="vector-sticky-header-icons"> <a href="#" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only" id="ca-talk-sticky-header" tabindex="-1" data-event-name="talk-sticky-header"><span class="vector-icon mw-ui-icon-speechBubbles mw-ui-icon-wikimedia-speechBubbles"></span> <span></span> </a> <a href="#" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only" id="ca-subject-sticky-header" tabindex="-1" data-event-name="subject-sticky-header"><span class="vector-icon mw-ui-icon-article mw-ui-icon-wikimedia-article"></span> <span></span> </a> <a href="#" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only" id="ca-history-sticky-header" tabindex="-1" data-event-name="history-sticky-header"><span class="vector-icon mw-ui-icon-wikimedia-history mw-ui-icon-wikimedia-wikimedia-history"></span> <span></span> </a> <a href="#" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only mw-watchlink" id="ca-watchstar-sticky-header" tabindex="-1" data-event-name="watch-sticky-header"><span class="vector-icon mw-ui-icon-wikimedia-star mw-ui-icon-wikimedia-wikimedia-star"></span> <span></span> </a> <a href="#" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only" id="ca-edit-sticky-header" tabindex="-1" data-event-name="wikitext-edit-sticky-header"><span class="vector-icon mw-ui-icon-wikimedia-wikiText mw-ui-icon-wikimedia-wikimedia-wikiText"></span> <span></span> </a> <a href="#" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only" id="ca-ve-edit-sticky-header" tabindex="-1" data-event-name="ve-edit-sticky-header"><span class="vector-icon mw-ui-icon-wikimedia-edit mw-ui-icon-wikimedia-wikimedia-edit"></span> <span></span> </a> <a href="#" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only" id="ca-viewsource-sticky-header" tabindex="-1" data-event-name="ve-edit-protected-sticky-header"><span class="vector-icon mw-ui-icon-wikimedia-editLock mw-ui-icon-wikimedia-wikimedia-editLock"></span> <span></span> </a> </div> <div class="vector-sticky-header-buttons"> <a href="#" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--action-progressive" id="ca-addsection-sticky-header" tabindex="-1" data-event-name="addsection-sticky-header"><span class="vector-icon mw-ui-icon-speechBubbleAdd-progressive mw-ui-icon-wikimedia-speechBubbleAdd-progressive"></span> <span>Add topic</span> </a> </div> <div class="vector-sticky-header-icon-end"> <div class="vector-user-links"> </div> </div> </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-b766959bd-r6rc4","wgBackendResponseTime":132,"wgDiscussionToolsPageThreads":[{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-Applications","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-Overview","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-Usage_considerations","replies":[{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-Ordinary_templates-Usage_considerations","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-Predefined_templates-Usage_considerations","replies":[]}]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-Partial_substitution","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-Multilevel_substitution","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-Multilevel_substitution_with_independent_control_of_each_substitution_separately","replies":[{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-Partial_substitution_2-Multilevel_substitution_with_independent_control_of_each_substitution_separately","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-Composite_operations-Multilevel_substitution_with_independent_control_of_each_substitution_separately","replies":[]}]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-includeonly","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-Creating_a_page_which_applies_substitution_on_the_next_save","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-Forced_substitution","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-Substitution_of_part_of_the_parameters","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-Limitations","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-Documenting_substitution","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-See_also","replies":[]}],"wgPageParseReport":{"discussiontools":{"limitreport-timeusage":"0.022"},"limitreport":{"cputime":"0.315","walltime":"0.420","ppvisitednodes":{"value":3186,"limit":1000000},"postexpandincludesize":{"value":12930,"limit":2097152},"templateargumentsize":{"value":2397,"limit":2097152},"expansiondepth":{"value":13,"limit":100},"expensivefunctioncount":{"value":10,"limit":500},"unstrip-depth":{"value":0,"limit":20},"unstrip-size":{"value":9595,"limit":5000000},"entityaccesscount":{"value":0,"limit":400},"timingprofile":["100.00% 141.433 1 -total"," 40.11% 56.734 9 Template:Ll"," 16.23% 22.951 1 Template:PD_Help_Page"," 15.58% 22.031 2 Template:Tl"," 13.88% 19.630 18 Template:Translatable"," 10.21% 14.437 7 Template:Tmpl"," 10.05% 14.210 2 Template:TNTN"," 9.20% 13.016 7 Template:Tag"," 8.64% 12.223 9 Template:Pagelang"," 7.97% 11.270 1 Template:Note"]},"scribunto":{"limitreport-timeusage":{"value":"0.025","limit":"10.000"},"limitreport-memusage":{"value":1144527,"limit":52428800}},"cachereport":{"origin":"mw-web.codfw.main-7f7789979b-56z2r","timestamp":"20250213210624","ttl":2592000,"transientcontent":false}}});});</script> </body> </html>