CINXE.COM

Wikipedia:TemplateData/Tutorial - Wikipedia

<!DOCTYPE html> <html class="client-nojs vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-enabled skin-theme-clientpref-day vector-toc-available" lang="en" dir="ltr"> <head> <meta charset="UTF-8"> <title>Wikipedia:TemplateData/Tutorial - Wikipedia</title> <script>(function(){var className="client-js vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-enabled skin-theme-clientpref-day vector-toc-available";var cookie=document.cookie.match(/(?:^|; )enwikimwclientpreferences=([^;]+)/);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":"ed9714e5-8c7b-432a-8f15-83eaa89d6d13","wgCanonicalNamespace":"Project","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":4,"wgPageName":"Wikipedia:TemplateData/Tutorial","wgTitle":"TemplateData/Tutorial","wgCurRevisionId":1224100297,"wgRevisionId":1224100297,"wgArticleId":39784750,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":["TemplateData","Wikipedia template help"],"wgPageViewLanguage":"en","wgPageContentLanguage":"en","wgPageContentModel":"wikitext","wgRelevantPageName":"Wikipedia:TemplateData/Tutorial","wgRelevantArticleId":39784750,"wgIsProbablyEditable":true,"wgRelevantPageIsProbablyEditable":true,"wgRestrictionEdit":[],"wgRestrictionMove":[],"wgRedirectedFrom":"Wikipedia:VisualEditor/TemplateData_tutorial","wgNoticeProject":"wikipedia", "wgCiteReferencePreviewsActive":false,"wgFlaggedRevsParams":{"tags":{"status":{"levels":1}}},"wgMediaViewerOnClick":true,"wgMediaViewerEnabledByDefault":true,"wgPopupsFlags":0,"wgVisualEditor":{"pageLanguageCode":"en","pageLanguageDir":"ltr","pageVariantFallbacks":"en"},"wgMFDisplayWikibaseDescriptions":{"search":true,"watchlist":true,"tagline":false,"nearby":true},"wgWMESchemaEditAttemptStepOversample":false,"wgWMEPageLength":30000,"wgInternalRedirectTargetUrl":"/wiki/Wikipedia:TemplateData/Tutorial","wgRelatedArticlesCompat":[],"wgCentralAuthMobileDomain":false,"wgEditSubmitButtonLabelPublish":true,"wgDiscussionToolsFeaturesEnabled":{"replytool":true,"newtopictool":true,"sourcemodetoolbar":true,"topicsubscription":false,"autotopicsub":false,"visualenhancements":false,"visualenhancements_reply":false,"visualenhancements_pageframe":false},"wgDiscussionToolsFallbackEditMode":"source","wgULSPosition":"interlanguage","wgULSisCompactLinksEnabled":false,"wgVector2022LanguageInHeader":true, "wgULSisLanguageSelectorEmpty":false,"wgWikibaseItemId":"Q14505594","wgCheckUserClientHintsHeadersJsApi":["brands","architecture","bitness","fullVersionList","mobile","model","platform","platformVersion"],"GEHomepageSuggestedEditsEnableTopics":true,"wgGETopicsMatchModeEnabled":false,"wgGEStructuredTaskRejectionReasonTextInputEnabled":false,"wgGELevelingUpEnabledForUser":false};RLSTATE={"ext.globalCssJs.user.styles":"ready","site.styles":"ready","user.styles":"ready","ext.globalCssJs.user":"ready","user":"ready","user.options":"loading","ext.pygments":"ready","ext.templateData":"ready","ext.templateData.images":"ready","jquery.tablesorter.styles":"ready","ext.discussionTools.init.styles":"ready","oojs-ui-core.styles":"ready","oojs-ui.styles.indicators":"ready","mediawiki.widgets.styles":"ready","oojs-ui-core.icons":"ready","skins.vector.search.codex.styles":"ready","skins.vector.styles":"ready","skins.vector.icons":"ready","ext.wikimediamessages.styles":"ready", "ext.visualEditor.desktopArticleTarget.noscript":"ready","ext.uls.interlanguage":"ready","wikibase.client.init":"ready","ext.wikimediaBadges":"ready"};RLPAGEMODULES=["mediawiki.action.view.redirect","ext.pygments.view","jquery.tablesorter","mediawiki.page.media","site","mediawiki.page.ready","mediawiki.toc","skins.vector.js","ext.centralNotice.geoIP","ext.centralNotice.startUp","ext.gadget.ReferenceTooltips","ext.gadget.switcher","ext.urlShortener.toolbar","ext.centralauth.centralautologin","mmv.bootstrap","ext.popups","ext.visualEditor.desktopArticleTarget.init","ext.visualEditor.targetLoader","ext.echo.centralauth","ext.discussionTools.init","ext.eventLogging","ext.wikimediaEvents","ext.navigationTiming","ext.uls.interface","ext.cx.eventlogging.campaigns","wikibase.client.vector-2022","ext.checkUser.clientHints","wikibase.sidebar.tracking"];</script> <script>(RLQ=window.RLQ||[]).push(function(){mw.loader.impl(function(){return["user.options@12s5i",function($,jQuery,require,module){mw.user.tokens.set({"patrolToken":"+\\","watchToken":"+\\","csrfToken":"+\\"}); }];});});</script> <link rel="stylesheet" href="/w/load.php?lang=en&amp;modules=ext.discussionTools.init.styles%7Cext.pygments%2CtemplateData%2CwikimediaBadges%7Cext.templateData.images%7Cext.uls.interlanguage%7Cext.visualEditor.desktopArticleTarget.noscript%7Cext.wikimediamessages.styles%7Cjquery.tablesorter.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&amp;only=styles&amp;skin=vector-2022"> <script async="" src="/w/load.php?lang=en&amp;modules=startup&amp;only=scripts&amp;raw=1&amp;skin=vector-2022"></script> <meta name="ResourceLoaderDynamicStyles" content=""> <link rel="stylesheet" href="/w/load.php?lang=en&amp;modules=site.styles&amp;only=styles&amp;skin=vector-2022"> <meta name="generator" content="MediaWiki 1.44.0-wmf.4"> <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:title" content="Wikipedia:TemplateData/Tutorial - Wikipedia"> <meta property="og:type" content="website"> <link rel="preconnect" href="//upload.wikimedia.org"> <link rel="alternate" media="only screen and (max-width: 640px)" href="//en.m.wikipedia.org/wiki/Wikipedia:TemplateData/Tutorial"> <link rel="alternate" type="application/x-wiki" title="Edit this page" href="/w/index.php?title=Wikipedia:TemplateData/Tutorial&amp;action=edit"> <link rel="apple-touch-icon" href="/static/apple-touch/wikipedia.png"> <link rel="icon" href="/static/favicon/wikipedia.ico"> <link rel="search" type="application/opensearchdescription+xml" href="/w/rest.php/v1/search" title="Wikipedia (en)"> <link rel="EditURI" type="application/rsd+xml" href="//en.wikipedia.org/w/api.php?action=rsd"> <link rel="canonical" href="https://en.wikipedia.org/wiki/Wikipedia:TemplateData/Tutorial"> <link rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en"> <link rel="alternate" type="application/atom+xml" title="Wikipedia Atom feed" href="/w/index.php?title=Special:RecentChanges&amp;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-4 ns-subject mw-editable page-Wikipedia_TemplateData_Tutorial rootpage-Wikipedia_TemplateData skin-vector-2022 action-view"><a class="mw-jump-link" href="#bodyContent">Jump to content</a> <div class="vector-header-container"> <header class="vector-header mw-header"> <div class="vector-header-start"> <nav class="vector-main-menu-landmark" aria-label="Site"> <div id="vector-main-menu-dropdown" class="vector-dropdown vector-main-menu-dropdown vector-button-flush-left vector-button-flush-right" > <input type="checkbox" id="vector-main-menu-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-main-menu-dropdown" class="vector-dropdown-checkbox " aria-label="Main menu" > <label id="vector-main-menu-dropdown-label" for="vector-main-menu-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-menu mw-ui-icon-wikimedia-menu"></span> <span class="vector-dropdown-label-text">Main menu</span> </label> <div class="vector-dropdown-content"> <div id="vector-main-menu-unpinned-container" class="vector-unpinned-container"> <div id="vector-main-menu" class="vector-main-menu vector-pinnable-element"> <div class="vector-pinnable-header vector-main-menu-pinnable-header vector-pinnable-header-unpinned" data-feature-name="main-menu-pinned" data-pinnable-element-id="vector-main-menu" data-pinned-container-id="vector-main-menu-pinned-container" data-unpinned-container-id="vector-main-menu-unpinned-container" > <div class="vector-pinnable-header-label">Main menu</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-main-menu.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-main-menu.unpin">hide</button> </div> <div id="p-navigation" class="vector-menu mw-portlet mw-portlet-navigation" > <div class="vector-menu-heading"> Navigation </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-mainpage-description" class="mw-list-item"><a href="/wiki/Main_Page" title="Visit the main page [z]" accesskey="z"><span>Main page</span></a></li><li id="n-contents" class="mw-list-item"><a href="/wiki/Wikipedia:Contents" title="Guides to browsing Wikipedia"><span>Contents</span></a></li><li id="n-currentevents" class="mw-list-item"><a href="/wiki/Portal:Current_events" title="Articles related to current events"><span>Current events</span></a></li><li id="n-randompage" class="mw-list-item"><a href="/wiki/Special:Random" title="Visit a randomly selected article [x]" accesskey="x"><span>Random article</span></a></li><li id="n-aboutsite" class="mw-list-item"><a href="/wiki/Wikipedia:About" title="Learn about Wikipedia and how it works"><span>About Wikipedia</span></a></li><li id="n-contactpage" class="mw-list-item"><a href="//en.wikipedia.org/wiki/Wikipedia:Contact_us" title="How to contact Wikipedia"><span>Contact us</span></a></li> </ul> </div> </div> <div id="p-interaction" class="vector-menu mw-portlet mw-portlet-interaction" > <div class="vector-menu-heading"> Contribute </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-help" class="mw-list-item"><a href="/wiki/Help:Contents" title="Guidance on how to use and edit Wikipedia"><span>Help</span></a></li><li id="n-introduction" class="mw-list-item"><a href="/wiki/Help:Introduction" title="Learn how to edit Wikipedia"><span>Learn to edit</span></a></li><li id="n-portal" class="mw-list-item"><a href="/wiki/Wikipedia:Community_portal" title="The hub for editors"><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 to Wikipedia [r]" accesskey="r"><span>Recent changes</span></a></li><li id="n-upload" class="mw-list-item"><a href="/wiki/Wikipedia:File_upload_wizard" title="Add images or other media for use on Wikipedia"><span>Upload file</span></a></li> </ul> </div> </div> </div> </div> </div> </div> </nav> <a href="/wiki/Main_Page" class="mw-logo"> <img class="mw-logo-icon" src="/static/images/icons/wikipedia.png" alt="" aria-hidden="true" height="50" width="50"> <span class="mw-logo-container skin-invert"> <img class="mw-logo-wordmark" alt="Wikipedia" src="/static/images/mobile/copyright/wikipedia-wordmark-en.svg" style="width: 7.5em; height: 1.125em;"> <img class="mw-logo-tagline" alt="The Free Encyclopedia" src="/static/images/mobile/copyright/wikipedia-tagline-en.svg" width="117" height="13" style="width: 7.3125em; height: 0.8125em;"> </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 Wikipedia [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 Wikipedia" aria-label="Search Wikipedia" autocapitalize="sentences" title="Search Wikipedia [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 emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </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&#039;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/wiki/Special:FundraiserRedirector?utm_source=donate&amp;utm_medium=sidebar&amp;utm_campaign=C13_en.wikipedia.org&amp;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&amp;returnto=Wikipedia%3ATemplateData%2FTutorial" 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&amp;returnto=Wikipedia%3ATemplateData%2FTutorial" title="You&#039;re encouraged to log in; however, it&#039;s 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="Log in and 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/wiki/Special:FundraiserRedirector?utm_source=donate&amp;utm_medium=sidebar&amp;utm_campaign=C13_en.wikipedia.org&amp;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&amp;returnto=Wikipedia%3ATemplateData%2FTutorial" 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&amp;returnto=Wikipedia%3ATemplateData%2FTutorial" title="You&#039;re encouraged to log in; however, it&#039;s 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">(Top)</div> </a> </li> <li id="toc-How_to_use_template_data" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#How_to_use_template_data"> <div class="vector-toc-text"> <span class="vector-toc-numb">1</span> <span>How to use template data</span> </div> </a> <button aria-controls="toc-How_to_use_template_data-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 How to use template data subsection</span> </button> <ul id="toc-How_to_use_template_data-sublist" class="vector-toc-list"> <li id="toc-The_structure_of_template_data" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#The_structure_of_template_data"> <div class="vector-toc-text"> <span class="vector-toc-numb">1.1</span> <span>The structure of template data</span> </div> </a> <ul id="toc-The_structure_of_template_data-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Template_data" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Template_data"> <div class="vector-toc-text"> <span class="vector-toc-numb">1.2</span> <span>Template data</span> </div> </a> <ul id="toc-Template_data-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Identifying_the_parameters" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Identifying_the_parameters"> <div class="vector-toc-text"> <span class="vector-toc-numb">1.3</span> <span>Identifying the parameters</span> </div> </a> <ul id="toc-Identifying_the_parameters-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Completing_the_template_data_information" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Completing_the_template_data_information"> <div class="vector-toc-text"> <span class="vector-toc-numb">1.4</span> <span>Completing the template data information</span> </div> </a> <ul id="toc-Completing_the_template_data_information-sublist" class="vector-toc-list"> <li id="toc-Save" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#Save"> <div class="vector-toc-text"> <span class="vector-toc-numb">1.4.1</span> <span>Save</span> </div> </a> <ul id="toc-Save-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-Worked_example" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Worked_example"> <div class="vector-toc-text"> <span class="vector-toc-numb">1.5</span> <span>Worked example</span> </div> </a> <ul id="toc-Worked_example-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Complete_empty_template_data_block" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Complete_empty_template_data_block"> <div class="vector-toc-text"> <span class="vector-toc-numb">1.6</span> <span>Complete empty template data block</span> </div> </a> <ul id="toc-Complete_empty_template_data_block-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Shared_documentation" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Shared_documentation"> <div class="vector-toc-text"> <span class="vector-toc-numb">1.7</span> <span>Shared documentation</span> </div> </a> <ul id="toc-Shared_documentation-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Help" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Help"> <div class="vector-toc-text"> <span class="vector-toc-numb">1.8</span> <span>Help</span> </div> </a> <ul id="toc-Help-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-Examples" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Examples"> <div class="vector-toc-text"> <span class="vector-toc-numb">2</span> <span>Examples</span> </div> </a> <ul id="toc-Examples-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Limitations_and_questions" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Limitations_and_questions"> <div class="vector-toc-text"> <span class="vector-toc-numb">3</span> <span>Limitations and questions</span> </div> </a> <ul id="toc-Limitations_and_questions-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Tools" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Tools"> <div class="vector-toc-text"> <span class="vector-toc-numb">4</span> <span>Tools</span> </div> </a> <ul id="toc-Tools-sublist" class="vector-toc-list"> </ul> </li> </ul> </div> </div> </nav> </div> </div> <div class="mw-content-container"> <main id="content" class="mw-body"> <header class="mw-body-header vector-page-titlebar"> <nav aria-label="Contents" class="vector-toc-landmark"> <div id="vector-page-titlebar-toc" class="vector-dropdown vector-page-titlebar-toc vector-button-flush-left" > <input type="checkbox" id="vector-page-titlebar-toc-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-page-titlebar-toc" class="vector-dropdown-checkbox " aria-label="Toggle the table of contents" > <label id="vector-page-titlebar-toc-label" for="vector-page-titlebar-toc-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-listBullet mw-ui-icon-wikimedia-listBullet"></span> <span class="vector-dropdown-label-text">Toggle the table of contents</span> </label> <div class="vector-dropdown-content"> <div id="vector-page-titlebar-toc-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <h1 id="firstHeading" class="firstHeading mw-first-heading"><span class="mw-page-title-namespace">Wikipedia</span><span class="mw-page-title-separator">:</span><span class="mw-page-title-main">TemplateData/Tutorial</span></h1> <div id="p-lang-btn" class="vector-dropdown mw-portlet mw-portlet-lang" > <input type="checkbox" id="p-lang-btn-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-p-lang-btn" class="vector-dropdown-checkbox mw-interlanguage-selector" aria-label="Go to an article in another language. Available in 10 languages" > <label id="p-lang-btn-label" for="p-lang-btn-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--action-progressive mw-portlet-lang-heading-10" aria-hidden="true" ><span class="vector-icon mw-ui-icon-language-progressive mw-ui-icon-wikimedia-language-progressive"></span> <span class="vector-dropdown-label-text">10 languages</span> </label> <div class="vector-dropdown-content"> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li class="interlanguage-link interwiki-de mw-list-item"><a href="https://de.wikipedia.org/wiki/Hilfe:TemplateData" title="Hilfe:TemplateData – German" lang="de" hreflang="de" data-title="Hilfe:TemplateData" data-language-autonym="Deutsch" data-language-local-name="German" class="interlanguage-link-target"><span>Deutsch</span></a></li><li class="interlanguage-link interwiki-es mw-list-item"><a href="https://es.wikipedia.org/wiki/Wikipedia:Editor_visual/Plantillas_tutorial" title="Wikipedia:Editor visual/Plantillas tutorial – Spanish" lang="es" hreflang="es" data-title="Wikipedia:Editor visual/Plantillas tutorial" data-language-autonym="Español" data-language-local-name="Spanish" class="interlanguage-link-target"><span>Español</span></a></li><li class="interlanguage-link interwiki-fr mw-list-item"><a href="https://fr.wikipedia.org/wiki/Aide:TemplateData" title="Aide:TemplateData – French" lang="fr" hreflang="fr" data-title="Aide:TemplateData" data-language-autonym="Français" data-language-local-name="French" class="interlanguage-link-target"><span>Français</span></a></li><li class="interlanguage-link interwiki-ilo mw-list-item"><a href="https://ilo.wikipedia.org/wiki/Wikipedia:VisualEditor/TemplateData/Pagsursuruan" title="Wikipedia:VisualEditor/TemplateData/Pagsursuruan – Iloko" lang="ilo" hreflang="ilo" data-title="Wikipedia:VisualEditor/TemplateData/Pagsursuruan" data-language-autonym="Ilokano" data-language-local-name="Iloko" class="interlanguage-link-target"><span>Ilokano</span></a></li><li class="interlanguage-link interwiki-is mw-list-item"><a href="https://is.wikipedia.org/wiki/Wikipedia:Visual_Editor/TemplateData_lei%C3%B0beiningar" title="Wikipedia:Visual Editor/TemplateData leiðbeiningar – Icelandic" lang="is" hreflang="is" data-title="Wikipedia:Visual Editor/TemplateData leiðbeiningar" data-language-autonym="Íslenska" data-language-local-name="Icelandic" class="interlanguage-link-target"><span>Íslenska</span></a></li><li class="interlanguage-link interwiki-frr mw-list-item"><a href="https://frr.wikipedia.org/wiki/Hilfe:TemplateData" title="Hilfe:TemplateData – Northern Frisian" lang="frr" hreflang="frr" data-title="Hilfe:TemplateData" data-language-autonym="Nordfriisk" data-language-local-name="Northern Frisian" class="interlanguage-link-target"><span>Nordfriisk</span></a></li><li class="interlanguage-link interwiki-pl mw-list-item"><a href="https://pl.wikipedia.org/wiki/Pomoc:Jak_doda%C4%87_TemplateData" title="Pomoc:Jak dodać TemplateData – Polish" lang="pl" hreflang="pl" data-title="Pomoc:Jak dodać TemplateData" data-language-autonym="Polski" data-language-local-name="Polish" class="interlanguage-link-target"><span>Polski</span></a></li><li class="interlanguage-link interwiki-si mw-list-item"><a href="https://si.wikipedia.org/wiki/%E0%B7%80%E0%B7%92%E0%B6%9A%E0%B7%92%E0%B6%B4%E0%B7%93%E0%B6%A9%E0%B7%92%E0%B6%BA%E0%B7%8F:TemplateData/Tutorial" title="විකිපීඩියා:TemplateData/Tutorial – Sinhala" lang="si" hreflang="si" data-title="විකිපීඩියා:TemplateData/Tutorial" data-language-autonym="සිංහල" data-language-local-name="Sinhala" class="interlanguage-link-target"><span>සිංහල</span></a></li><li class="interlanguage-link interwiki-tr mw-list-item"><a href="https://tr.wikipedia.org/wiki/Vikipedi:TemplateData/Rehber" title="Vikipedi:TemplateData/Rehber – Turkish" lang="tr" hreflang="tr" data-title="Vikipedi:TemplateData/Rehber" data-language-autonym="Türkçe" data-language-local-name="Turkish" class="interlanguage-link-target"><span>Türkçe</span></a></li><li class="interlanguage-link interwiki-zh mw-list-item"><a href="https://zh.wikipedia.org/wiki/Wikipedia:%E6%A8%A1%E6%9D%BF%E6%95%B0%E6%8D%AE/%E6%95%99%E5%AD%A6" title="Wikipedia:模板数据/教学 – Chinese" lang="zh" hreflang="zh" data-title="Wikipedia:模板数据/教学" 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/Q14505594#sitelinks-wikipedia" title="Edit interlanguage links" class="wbc-editpage">Edit links</a></span></div> </div> </div> </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-project" class="selected vector-tab-noicon mw-list-item"><a href="/wiki/Wikipedia:TemplateData/Tutorial" title="View the project page [c]" accesskey="c"><span>Project page</span></a></li><li id="ca-talk" class="vector-tab-noicon mw-list-item"><a href="/wiki/Wikipedia_talk:TemplateData/Tutorial" rel="discussion" class="mw-redirect" title="Discuss improvements to the content page [t]" accesskey="t"><span>Talk</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/Wikipedia:TemplateData/Tutorial"><span>Read</span></a></li><li id="ca-edit" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Wikipedia:TemplateData/Tutorial&amp;action=edit" title="Edit this page [e]" accesskey="e"><span>Edit</span></a></li><li id="ca-history" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Wikipedia:TemplateData/Tutorial&amp;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/Wikipedia:TemplateData/Tutorial"><span>Read</span></a></li><li id="ca-more-edit" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=Wikipedia:TemplateData/Tutorial&amp;action=edit" title="Edit this page [e]" accesskey="e"><span>Edit</span></a></li><li id="ca-more-history" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=Wikipedia:TemplateData/Tutorial&amp;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/Wikipedia:TemplateData/Tutorial" title="List of all English Wikipedia pages containing links to this page [j]" accesskey="j"><span>What links here</span></a></li><li id="t-recentchangeslinked" class="mw-list-item"><a href="/wiki/Special:RecentChangesLinked/Wikipedia:TemplateData/Tutorial" 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="/wiki/Wikipedia:File_Upload_Wizard" title="Upload files [u]" accesskey="u"><span>Upload file</span></a></li><li id="t-specialpages" class="mw-list-item"><a href="/wiki/Special:SpecialPages" title="A list of all special pages [q]" accesskey="q"><span>Special pages</span></a></li><li id="t-permalink" class="mw-list-item"><a href="/w/index.php?title=Wikipedia:TemplateData/Tutorial&amp;oldid=1224100297" 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=Wikipedia:TemplateData/Tutorial&amp;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&amp;url=https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FWikipedia%3ATemplateData%2FTutorial"><span>Get shortened URL</span></a></li><li id="t-urlshortener-qrcode" class="mw-list-item"><a href="/w/index.php?title=Special:QrCode&amp;url=https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FWikipedia%3ATemplateData%2FTutorial"><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-download-as-rl" class="mw-list-item"><a href="/w/index.php?title=Special:DownloadAsPdf&amp;page=Wikipedia%3ATemplateData%2FTutorial&amp;action=show-download-screen" title="Download this page as a PDF file"><span>Download as PDF</span></a></li><li id="t-print" class="mw-list-item"><a href="/w/index.php?title=Wikipedia:TemplateData/Tutorial&amp;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-mediawiki mw-list-item"><a href="https://www.mediawiki.org/wiki/Help:TemplateData" hreflang="en"><span>MediaWiki</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/Q14505594" title="Structured data on this page hosted by Wikidata [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 class="mw-indicators"> </div> <div id="siteSub" class="noprint">From Wikipedia, the free encyclopedia</div> </div> <div id="contentSub"><div id="mw-content-subtitle"><div class="subpages">&lt; <bdi dir="ltr"><a href="/wiki/Wikipedia:TemplateData" title="Wikipedia:TemplateData">Wikipedia:TemplateData</a></bdi></div><span class="mw-redirectedfrom">(Redirected from <a href="/w/index.php?title=Wikipedia:VisualEditor/TemplateData_tutorial&amp;redirect=no" class="mw-redirect" title="Wikipedia:VisualEditor/TemplateData tutorial">Wikipedia:VisualEditor/TemplateData tutorial</a>)</span></div></div> <div id="mw-content-text" class="mw-body-content"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr"><div class="shortdescription nomobile noexcerpt noprint searchaux" style="display:none">Wikimedia project gadget tutorial</div> <style data-mw-deduplicate="TemplateStyles:r1252059228">.mw-parser-output .module-shortcutboxplain{float:right;margin:0 0 0 1em;border:1px solid var(--border-color-base,#a2a9b1);background-color:var(--background-color-base,#fff);padding:0.3em 0.6em 0.2em 0.6em;text-align:center;font-size:85%}.mw-parser-output .module-shortcutboxleft{float:left;margin:0 1em 0 0}.mw-parser-output .module-shortcutlist{display:inline-block;border-bottom:1px solid var(--border-color-base,#a2a9b1);margin-bottom:0.2em}.mw-parser-output .module-shortcutboxplain ul{font-weight:bold}.mw-parser-output .module-shortcutanchordiv{position:relative;top:-3em}.mw-parser-output li .module-shortcutanchordiv{float:right}.mw-parser-output .mbox-imageright .module-shortcutboxplain{padding:0.4em 1em 0.4em 1em;line-height:1.3;margin:0}</style><div class="module-shortcutanchordiv"><span id="WP:TDATA/T"></span><span id="WP:VE/TDT"></span></div><div class="module-shortcutboxplain noprint" role="note"><div class="module-shortcutlist"><a href="/wiki/Wikipedia:Shortcut" title="Wikipedia:Shortcut">Shortcuts</a></div><style data-mw-deduplicate="TemplateStyles:r1126788409">.mw-parser-output .plainlist ol,.mw-parser-output .plainlist ul{line-height:inherit;list-style:none;margin:0;padding:0}.mw-parser-output .plainlist ol li,.mw-parser-output .plainlist ul li{margin-bottom:0}</style><div class="plainlist"><ul><li><span class="plainlinks"><a class="external text" href="https://en.wikipedia.org/w/index.php?title=Wikipedia:TDATA/T&amp;redirect=no">WP:TDATA/T</a></span></li><li><span class="plainlinks"><a class="external text" href="https://en.wikipedia.org/w/index.php?title=Wikipedia:VE/TDT&amp;redirect=no">WP:VE/TDT</a></span></li></ul></div></div> <div class="plainlinks" style="float:right; clear:right; margin:0 0 5px 5px; font-size: 90%; border:1px solid #AAAAAA; width:21em; padding:.5em;"> <figure class="mw-halign-center" typeof="mw:File"><a href="/wiki/Wikipedia:VisualEditor" title="Wikipedia:VisualEditor"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/1/12/VisualEditor-logo.svg/200px-VisualEditor-logo.svg.png" decoding="async" width="200" height="70" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/1/12/VisualEditor-logo.svg/300px-VisualEditor-logo.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/1/12/VisualEditor-logo.svg/400px-VisualEditor-logo.svg.png 2x" data-file-width="641" data-file-height="225"/></a><figcaption></figcaption></figure> <hr/> <ul><li><a href="/wiki/Wikipedia:VisualEditor" title="Wikipedia:VisualEditor">Main page</a></li> <li><a href="https://www.mediawiki.org/wiki/VisualEditor/Feedback" class="extiw" title="mw:VisualEditor/Feedback">Feedback at MediaWiki</a></li> <li><a class="external text" href="https://en.wikipedia.org/wiki/Draft:Sandbox?veaction=edit">Sandbox</a> <small>(no account required)</small></li></ul> <hr/> <div style="text-align:center;">About</div> <hr/> <ul><li>Documentation: <ul><li><a href="/wiki/Help:Introduction" title="Help:Introduction">Introductory tutorial</a></li> <li><a href="/wiki/Help:VisualEditor" title="Help:VisualEditor">User guide</a></li> <li><a href="/wiki/Help:VisualEditor/Keyboard_shortcuts" title="Help:VisualEditor/Keyboard shortcuts">Keyboard shortcuts</a></li> <li><a href="/wiki/Wikipedia:VisualEditor/FAQ" title="Wikipedia:VisualEditor/FAQ">Frequently Asked Questions</a> (or <a href="https://www.mediawiki.org/wiki/VisualEditor/FAQ" class="extiw" title="mw:VisualEditor/FAQ">at MediaWiki</a>)</li></ul></li> <li>Development: <ul><li><a href="https://www.mediawiki.org/wiki/VisualEditor/Roadmap" class="extiw" title="mw:VisualEditor/Roadmap">Roadmap</a> up to 2017</li> <li><a href="/wiki/Wikipedia:VisualEditor/Updates" title="Wikipedia:VisualEditor/Updates">Updates</a> (2013-2023)</li> <li><a href="https://www.mediawiki.org/wiki/VisualEditor/changelog" class="extiw" title="mw:VisualEditor/changelog">Weekly status reports</a> (2015-2016)</li></ul></li></ul> <hr/> <div style="text-align:center;">Help out</div> <hr/> <ul><li><a href="/wiki/Wikipedia:VisualEditor/Help" title="Wikipedia:VisualEditor/Help">Update the help pages</a></li> <li><a href="/wiki/Wikipedia:TemplateData" title="Wikipedia:TemplateData">Add template data</a> (<a class="mw-selflink selflink">Tutorial</a>)</li> <li><a href="https://www.mediawiki.org/wiki/VisualEditor/Portal/Localization" class="extiw" title="mw:VisualEditor/Portal/Localization">Translate and localize documentation</a></li></ul> <hr/> <div style="text-align:center;">Research</div> <hr/> <ul><li><a href="https://meta.wikimedia.org/wiki/Research:VisualEditor%27s_effect_on_newly_registered_editors" class="extiw" title="meta:Research:VisualEditor's effect on newly registered editors">Main research page</a></li></ul> <hr/> <div style="text-align:center;">Other</div> <hr/> <ul><li><a href="/wiki/Wikipedia:VisualEditor/Why" title="Wikipedia:VisualEditor/Why">Why are the developers building this?</a> (2013) <ul><li><a href="/wiki/Wikipedia:VisualEditor/Why/User_Test_Data" title="Wikipedia:VisualEditor/Why/User Test Data">User Test Data</a> (2013)</li></ul></li> <li><a href="/wiki/Wikipedia:VisualEditor/Customization" title="Wikipedia:VisualEditor/Customization">Customization</a></li> <li><a href="/wiki/Wikipedia:VisualEditor/Known_problems" title="Wikipedia:VisualEditor/Known problems">Known problems</a></li> <li>Requests for Comments (RfCs): <a href="/wiki/Wikipedia:VisualEditor/RFC" title="Wikipedia:VisualEditor/RFC">Jul 2013 a</a>, <a href="/wiki/Wikipedia:VisualEditor/Default_State_RFC" title="Wikipedia:VisualEditor/Default State RFC">Jul 2013 b</a>, <a href="/wiki/Wikipedia:Village_pump_(proposals)/Archive_125#Discussion_-_Gradually_enabling_VisualEditor_for_new_accounts" title="Wikipedia:Village pump (proposals)/Archive 125">Jul 2015</a>, <a href="/wiki/Wikipedia:Village_pump_(proposals)/Archive_127#Enabling_VisualEditor_for_existing_accounts_which_are_dormant_or_inexperienced" title="Wikipedia:Village pump (proposals)/Archive 127">Sep 2015</a></li></ul> </div> <p><a href="/wiki/Wikipedia:VisualEditor/TemplateData" class="mw-redirect" title="Wikipedia:VisualEditor/TemplateData">Template data</a> is a way of storing information about a template—such as parameter names, or a description of the template—so that the <a href="/wiki/Wikipedia:VisualEditor" title="Wikipedia:VisualEditor">VisualEditor</a> can retrieve it and populate the template editor with it. It does <i>not</i> change anything about the actual <i>template</i> with which it appears, and nothing you can do with template data will affect the functionality of or "break" any existing Wikipedia template (though mistakes that appear in the template data might cause editors to use the associated template or its parameters incorrectly, so care is still needed). Template data is controlled by MediaWiki's <a href="https://www.mediawiki.org/wiki/Extension:TemplateData" class="extiw" title="mw:Extension:TemplateData">TemplateData extension</a>, which allows users to write small bits of structured data to a template page, or to be transcluded into that template page (such as on the standard documentation page). Once a template has this structured data, it can be displayed properly in the VisualEditor. While this may sound complex, it's actually very easy. </p> <meta property="mw:PageProp/toc"/> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="How_to_use_template_data" data-mw-thread-id="h-How_to_use_template_data"><span data-mw-comment-start="" id="h-How_to_use_template_data"></span>How to use template data<span data-mw-comment-end="h-How_to_use_template_data"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Wikipedia:TemplateData/Tutorial&amp;action=edit&amp;section=1" title="Edit section: How to use template data"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-How_to_use_template_data","replies":["h-The_structure_of_template_data-How_to_use_template_data","h-Template_data-How_to_use_template_data","h-Identifying_the_parameters-How_to_use_template_data","h-Completing_the_template_data_information-How_to_use_template_data","h-Worked_example-How_to_use_template_data","h-Complete_empty_template_data_block-How_to_use_template_data","h-Shared_documentation-How_to_use_template_data","h-Help-How_to_use_template_data"]}}--></div> <div class="mw-heading mw-heading3"><h3 id="The_structure_of_template_data" data-mw-thread-id="h-The_structure_of_template_data-How_to_use_template_data"><span data-mw-comment-start="" id="h-The_structure_of_template_data-How_to_use_template_data"></span>The structure of template data<span data-mw-comment-end="h-The_structure_of_template_data-How_to_use_template_data"></span></h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Wikipedia:TemplateData/Tutorial&amp;action=edit&amp;section=2" title="Edit section: The structure of template data"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <style data-mw-deduplicate="TemplateStyles:r1236090951">.mw-parser-output .hatnote{font-style:italic}.mw-parser-output div.hatnote{padding-left:1.6em;margin-bottom:0.5em}.mw-parser-output .hatnote i{font-style:normal}.mw-parser-output .hatnote+link+.hatnote{margin-top:-0.5em}@media print{body.ns-0 .mw-parser-output .hatnote{display:none!important}}</style><div role="note" class="hatnote navigation-not-searchable">See also: <a href="https://www.mediawiki.org/wiki/Help:TemplateData" class="extiw" title="mw:Help:TemplateData">mw:Help:TemplateData</a> and <a href="https://www.mediawiki.org/wiki/Extension:TemplateData" class="extiw" title="mw:Extension:TemplateData">mw:Extension:TemplateData</a></div> <p>Template data's central structure is encoded in <a href="/wiki/JSON" title="JSON">JSON</a> format, and the schema is fairly simple. The first thing to do is to type out a pair of <code>&lt;templatedata></code> tags directly on the template page itself inside <code class="nowrap" style="">&lt;noinclude>...&lt;/noinclude></code> tags, or anywhere on the template's documentation sub-page if it has one, like so: </p> <div class="mw-highlight mw-highlight-lang-xml mw-content-ltr" dir="ltr"><pre><span></span><span class="nt">&lt;templatedata></span> TemplateData<span class="w"> </span>goes<span class="w"> </span>here <span class="nt">&lt;/templatedata></span> </pre></div> <p><small>N.B. The preceding is incorrect code if used as it is and will therefore throw a JSON error if used; see <a href="#Completing_the_template_data_information">#Completing the template data information</a> below for more information.</small> </p><p>This tells the software that everything between the two tags is template data, and should be referenced when the template is used. The template data itself follows a standard layout that identifies the parameters that may be set within the template. </p><p>On English Wikipedia, you can also use the <span class="nowrap">{{</span><a href="/wiki/Template:Format_TemplateData" title="Template:Format TemplateData">Format TemplateData</a><span class="nowrap">}}</span> template to generate a more "conventional" presentation of template data suitable for use in <a href="/wiki/Wikipedia:Template_documentation" title="Wikipedia:Template documentation">Template documentation</a>. Instead of the above, write this at the top of the documentation page: </p> <div class="mw-highlight mw-highlight-lang-xml mw-content-ltr" dir="ltr"><pre><span></span>{{Format<span class="w"> </span>TemplateData |1=<span class="nt">&lt;templatedata></span> TemplateData<span class="w"> </span>goes<span class="w"> </span>here <span class="nt">&lt;/templatedata></span> |TOC=1 }} </pre></div> <div class="mw-heading mw-heading3"><h3 id="Template_data" data-mw-thread-id="h-Template_data-How_to_use_template_data"><span data-mw-comment-start="" id="h-Template_data-How_to_use_template_data"></span>Template data<span data-mw-comment-end="h-Template_data-How_to_use_template_data"></span></h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Wikipedia:TemplateData/Tutorial&amp;action=edit&amp;section=3" title="Edit section: Template data"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>The template data is added to the template page itself inside <code>&lt;noinclude>&lt;/noinclude></code> tags, or anywhere on the template's documentation page if it has one. In some cases, the main template page will be locked to prevent editing by unauthorized users. In that situation, the template data can only be added to the /doc page; the link to that page is at the bottom of the main page. </p><p>The template data is generally placed after the descriptive information about the template, and before the "See also" section. </p><p><b>Note</b>: You should add {{<a href="/wiki/Template:TemplateData_header" title="Template:TemplateData header">TemplateData header</a>}} directly in front of the <code>&lt;templatedata></code> tag. This will categorize the page as template data documentation and allow later organization of templates and their documentations. </p> <div class="mw-heading mw-heading3"><h3 id="Identifying_the_parameters" data-mw-thread-id="h-Identifying_the_parameters-How_to_use_template_data"><span data-mw-comment-start="" id="h-Identifying_the_parameters-How_to_use_template_data"></span>Identifying the parameters<span data-mw-comment-end="h-Identifying_the_parameters-How_to_use_template_data"></span></h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Wikipedia:TemplateData/Tutorial&amp;action=edit&amp;section=4" title="Edit section: Identifying the parameters"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>If the template has no parameters, you can complete its template data block with a simple line of<code> "params": {}</code>. If you do not include this line, you will not be able to save the page. This completes the template data for the template. </p><p>However, most templates have parameters, such as dates, URLs, article names, images, numbers or strings. Determine which parameters are or may be used in the template. Parameters may be passed by equal signs. For instance, the <code>{{cite web}}</code> template is passed values to complete a citation, such as <code>url=</code>, <code>title=</code>, <code>access-date=</code>, <i>etc.</i> Other parameters may be used by their position instead. In this case, use numbers "<code>1</code>", "<code>2</code>", <i>etc.</i> instead of names for the parameters. </p><p>The <a href="/wiki/Wikipedia:Template_documentation" title="Wikipedia:Template documentation">template documentation</a> on the main or sub-page may summarize which parameters can be set on a template, and what each parameter must include. Also, template data must be included in the template documentation page. </p> <div class="mw-heading mw-heading3"><h3 id="Completing_the_template_data_information" data-mw-thread-id="h-Completing_the_template_data_information-How_to_use_template_data"><span data-mw-comment-start="" id="h-Completing_the_template_data_information-How_to_use_template_data"></span>Completing the template data information<span data-mw-comment-end="h-Completing_the_template_data_information-How_to_use_template_data"></span></h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Wikipedia:TemplateData/Tutorial&amp;action=edit&amp;section=5" title="Edit section: Completing the template data information"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Remember, template data information is both information <i>about</i> how a template is meant to be used by editors, and programming code that tells the VisualEditor how to help editors add a template to a page. Nothing you do here will affect the corresponding template, though creating a template data entry that contains errors may cause problems for editors trying to use that template in an article. </p><p>The first piece of information to fill out is a <code>"description"</code> for the overall template, which is fairly self-explanatory; it briefly describes what the template does and explains where and how the user might want to use it. If the template was created and given some kind of description by someone before you, you may use information that you glean from the top of the main or sub-page of the template, which you can copy and paste here. Place it within quotes and follow it with a comma: <code>"description": "This template generates an information box for Croatian football players",</code>). Note that any wikitext typed anywhere in the template data table such as <code>[[Croatian football]]</code> will not retain any of its functions and will appear as plain unlinked text, character for character. </p><p>Next, you should create a <code>"params"</code> block, with braces (<code>{</code> and <code>}</code>). Inside this block, you need to create a sub-block for each parameter used by the template, with some of the following entries. Most of it is optional, but the more information you give the easier it will be for others to re-use the template. </p> <dl><dd><ul><li>Create or use the short arbitrary <code>"name"</code> for the parameter that will be read by the Wikipedia template software. If you use or the template has a parameter name containing more than one word, these must always be separated by an underscore: <code>_</code> like this: <code>ocean_size</code> (i.e., parameter names do not contain spaces). Place it between double quotes, follow it with a colon, and create a block with some more single braces <code>{</code> and <code>}</code> like this: <code>"ocean_size": { }</code> or <code>"range_map": { }</code>. Note that many templates like <span class="nowrap">{{</span><a href="/wiki/Template:Infobox_Faberg%C3%A9_egg" title="Template:Infobox Fabergé egg">Infobox Fabergé egg</a><span class="nowrap">}}</span> have a variable which is itself called "name", and therefore the JSON code for this parameter would be written <code>"name": { }</code>. The following code now goes within these braces, separated by a comma at the end of each but none after the last, and with no additional braces (Note that the order of these entries is irrelevant: they will be ordered in a consistent pattern when the JSON template data code is read): <ul><li>The <code>"<b>label</b>"</code> entry is a human-readable title for the parameter that will be displayed within the template editor. Capitalize the first character of the label (since it will be the leftmost value in the resulting table), and put it in quotes, like this: <code>"Ocean size":</code>.</li> <li>Enter the parameter's <code>"<b>description</b>"</code> (i.e., a description of the specific parameter, not the template as a whole). This may already have been written on the template's main or documentation page, and can be copied and pasted into place. Put this information in quotes. If you wish your description to also display a word or phrase in quotes, you must <a href="/wiki/Escape_character" title="Escape character">escape</a> the quotation marks by putting a backslash <code>\</code> directly <i>before</i> them like this: <code>"This parameter indicates the \"size\" of the ocean"</code>. If you do not provide the backslash directly before the quotation mark, the JSON software will interpret the mark as the end of the parameter block— the backslash tells JSON, "Don't count the quotation mark directly following me— render it as a visible quotation mark and look for the end-of-parameter quotation mark further on". If the word you wish to display in quotes is at the very end of your parameter description, you will just need to type <code>\""</code> like this: <code>"This parameter indicates the ocean \"size\""</code> You may include any other punctuation (comma, semicolon, colon, brace, bracket, double bracket, etc.) between the two quotation marks as you like. Note, however, that should you need an actual backslash <code>\</code> as part of the text, you will have to escape that too with another backslash, like this: <code>\\</code>.</li> <li>You can optionally set a flag on the status of the parameter: <ul><li><code>"<b>required</b>"</code> says that filling out the parameter is mandatory for that template. Only set this to <code>true</code> if the value is required for the template, and not setting a value will break the template (like the URL for <a href="/wiki/Template:Cite_web" title="Template:Cite web">Cite web</a>). Entries for this flag must be either the word <code>true</code> or <code>false</code>, with no quotation marks.</li> <li><code>"<b>suggested</b>"</code> says this is one variable that most users of the template will probably want to fill in (like the source date for a citation). <mark>You should almost always have at least one suggested parameter on a template.</mark> Like <code>required</code>, use either the word <code>true</code> or <code>false</code>, with no quotation marks.</li> <li><code>"<b>deprecated</b>"</code> can be set to flag whether or not this parameter is in regular use – as well as setting to <code>true</code>, you can write a brief description about what users should do instead. Rare.</li></ul></li> <li>The <code>"<b>aliases</b>"</code> group lets you list other names for this parameter which have been set to work equally well, and its entry is enclosed by a single bracket, i.e., <code>"aliases": [ "2", "Caption", "imagecaption" ]</code>. An alias is an alternative name for the parameter that the template is willing to accept instead of (not in addition to) the primary name. Aliases are not documented in a separate parameter object.</li></ul></li> <li>The <code>"<b>autovalue</b>"</code> entry lets you tell VisualEditor and other tools to pre-fill this parameter with a standard value (in wikitext); this text will show up in the parameter box when users edit, and will be added to the template invocation when saved. This may be useful for cleanup templates to automatically set the date the user adds a template. For example, add <code>"autovalue": "{{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}"</code> as the autovalue to have the relevant date, "November 2024" automatically added when an editor uses the template(<a class="external text" href="https://en.wikipedia.org/w/index.php?title=Template:Citation_needed/doc&amp;diff=631687918&amp;oldid=628385301">example edit</a>). Autovalues may be changed by the editor simply by removing the supplied value in the template dialog. Note that this subst-based method <a href="https://bugzilla.wikimedia.org/show_bug.cgi?id=2700" class="extiw" title="bugzilla:2700">does <b>not</b> work</a> for any templates that are used inside &lt;ref> tags, gallery tags, or other extension-specific tags. Whether or not set by the person creating the template data code, this entry, whatever it is, will appear as an entry in the resulting template data table; if not created manually, it will be followed by the word "Empty".</li> <li>The <code>"<b>default</b>"</code> setting lets you show what the template will do if this parameter is not set (or is set but left blank); this text will show up as light gray text in the parameter box when users edit, but will not add the value to the template invocation when saved unless the user manually overrides it. Rare. This entry will always appear in the resulting template data table, and if not manually created by the person writing the template data code, will be followed by the word "Empty".</li> <li>The <code>"<b>example</b>"</code> entry allows you to display an example of an entry that a person might make for this variable, written exactly as a person might type it, character-for-character; if the type of entry has already been set with the <code>"<b>type</b>"</code> parameter (see below), then the example should reflect this (i.e., if the type has been set to "wiki-page-name" then your example should <i>not</i> include a prefix like "File:" or "Image:"). Be sure to enclose the entire text of the example with quotes. Obviously, this means the actual example may not contain quotation marks itself. If not created by the person writing the template data code, will be followed by the word "Empty".</li> <li>The <code>"<b>type</b>"</code>, which controls how the template editor will interpret that parameter. This can be one of a few values, any of which used must be enclosed in double quotation marks:</li></ul></dd></dl> <table class="wikitable"> <tbody><tr> <th> <p>String Value </p> </th> <th> <p>Type of Parameter </p> </th></tr> <tr> <td><code>"unknown"</code> </td> <td>Assumed type if not set </td></tr> <tr> <td><code>"number"</code> </td> <td>Any numerical value (without decimal points or thousand separators) </td></tr> <tr> <td><code>"string"</code> </td> <td>Any textual value. May contain line breaks. </td></tr> <tr> <td><code>"line"</code> </td> <td>Short text field – use for names, labels, and other short-form fields. This is supposed to be text that is not expected to contain line breaks. </td></tr> <tr> <td><code>"wiki-page-name"</code> </td> <td>A valid MediaWiki page name for the current wiki. Doesn't have to exist, but if not, should be a valid page name which could be created. </td></tr> <tr> <td><code>"wiki-file-name"</code> </td> <td>A valid MediaWiki file name for the current wiki. Doesn't have to exist, but if not, should be a valid file name which could be uploaded. Should not include the namespace (e.g. "Foo.svg" not "File:Foo.svg" or "Bild:Foo.svg"). </td></tr> <tr> <td><code>"wiki-user-name"</code> </td> <td>A valid MediaWiki user name for the current wiki. Doesn't have to exist, but if not, should be a valid user name which could be created. Should not include the namespace (e.g. "Foo" not "User:Foo" or "Usario:Foo"). </td></tr> <tr> <td><code>"content"</code> </td> <td>Page content in wikitext, such as text style, links, images, <i>etc.</i> </td></tr> <tr> <td><code>"unbalanced-wikitext"</code> </td> <td>Raw wikitext that should not be treated as standalone content because it is unbalanced – for example, templates concatenating incomplete wikitext as a bigger whole, such as<code>{{echo|before=&lt;u>|after=&lt;/u>}}</code> </td></tr> <tr> <td><code>"date"</code> </td> <td>A date in <a href="/wiki/ISO_8601" title="ISO 8601">ISO 8601</a> format, e.g. "2014-05-09" or "2014-05-09T16:01:12Z" </td></tr></tbody></table> <dl><dd><ul><li>The <code>"<b>suggestedvalues</b>"</code> parameter property lets you define a list of parameter values to be shown to VisualEditor users for easy selection. Once the values have been added to TemplateData, the VisualEditor will display them in a combo box (a dropdown into which users can also enter a custom value). The user selects the desired value by clicking on it. For the suggested values to be displayed in the VisualEditor, the parameter’s type must be one of the following: content, line, string, number, unknown or unbalanced wikitext. Adding this parameter property can be done either in JSON or using the TemplateData Editor with no coding required. <a href="https://meta.wikimedia.org/wiki/WMDE_Technical_Wishes/Suggested_values_for_template_parameters#TemplateData" class="extiw" title="m:WMDE Technical Wishes/Suggested values for template parameters">Both methods are explained here.</a></li> <li><code>"inherits"</code>. This is a key to another parameter. The current parameter will inherit from that one, with local properties overriding the inherited ones. Very rare. <b>Currently, the inclusion of this parameter in a <code>&lt;templatedata></code> sub-block will cause the page to produce a <i>Required property "params." not found.</i> error and will fail to generate the expected table.</b></li></ul></dd></dl> <p> Where more than one parameter sub-blocks is passed to the template, you must add a comma after the close brace, <code>},</code>, between the sub-blocks. Do not place a comma after the last sub-block in your set, but do make sure that there is a final close brace, <code>}</code>. </p><p>A further option, <code>"format"</code>, determines how the wikitext code for the template will be formatted when it is saved by the VisualEditor. The primary options are <code>"format": "inline"</code> (the default) and <code>"format": "block"</code>. With the inline option, the wikitext of the template will be formatted as single-line <code>{{Sister project|project = commons|text = page in commons}}</code> and with the block option, each parameter will be placed on a new line </p> <div class="mw-highlight mw-highlight-lang-wikitext mw-content-ltr" dir="ltr"><pre><span></span><span class="p">{{</span><span class="nt">Infobox television</span> <span class="p">|</span><span class="nl"> name </span><span class="o">=</span> Father Ted <span class="p">|</span><span class="nl"> genre </span><span class="o">=</span> Comedy <span class="p">}}</span> </pre></div> <p>This option may be preferable for very complex templates like infoboxes which have multiple parameters. The documentation page indicated the format with the line <span style="font-size:85%;">"This template prefers inline formatting of parameters."</span> or <span style="font-size:85%;">"This template prefers block formatting of parameters."</span> </p><p>For more complex parameter formatting options, see <a href="https://www.mediawiki.org/wiki/Help:TemplateData#Custom_formats" class="extiw" title="mw:Help:TemplateData">mw:Help:TemplateData#Custom_formats</a>. </p> <div class="mw-heading mw-heading4"><h4 id="Save" data-mw-thread-id="h-Save-Completing_the_template_data_information"><span data-mw-comment-start="" id="h-Save-Completing_the_template_data_information"></span>Save<span data-mw-comment-end="h-Save-Completing_the_template_data_information"></span></h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Wikipedia:TemplateData/Tutorial&amp;action=edit&amp;section=6" title="Edit section: Save"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Once you're done, hit "save". If you've made errors, it will not let you save – which can be a little frustrating, as the resulting error message will not tell you where JSON encountered the first code error, but means you cannot "break" anything or put up a table that is accidentally malformed. If you find you are unable to save because of a code error, some common problems to look for include: </p> <ul><li>Is every opening quote (<code>"</code>) matched with a closing quote in the correct place of the code?</li> <li>Does a string, such as a description of a parameter, contain a <code>"</code> that is not at the end of the entry? If so, consider replacing it with a <code>'</code>.</li> <li>Is every opening brace(<code>{</code>) matched with a closing brace(<code>}</code>) in the correct place?</li> <li>Are there commas between params blocks? (There should be one).</li></ul> <p>Manually searching through the program for these errors can be tiresome and difficult. Fortunately, a number of program checking websites for JSON exist which will at least identify the line on which the program first encounters an error. <a rel="nofollow" class="external autonumber" href="http://jsonlint.com/">[1]</a> is one of these which seems to work quite well. Simply copy and paste the problematic JSON code into the corresponding box on the website and ask it to check the code— it will not itemize every error in the document, but it <i>will</i> indicate the <i>first</i> error it encounters, if any, which should be immensely helpful in correcting your code. </p><p>Once you successfully save the page, it may take a few minutes after saving for the template data to be integrated into VisualEditor. If it doesn't come through after a few minutes, you can make a <a href="/wiki/Wikipedia:Null" class="mw-redirect" title="Wikipedia:Null">null</a> edit on the main template to fix this. As many templates are protected, you may need to request a null edit using <span class="nowrap">{{</span><a href="/wiki/Template:Editprotected" class="mw-redirect" title="Template:Editprotected">editprotected</a><span class="nowrap">}}</span> or leaving a note on <a href="/wiki/Wikipedia_talk:VisualEditor/TemplateData_tutorial" class="mw-redirect" title="Wikipedia talk:VisualEditor/TemplateData tutorial">Wikipedia talk:VisualEditor/TemplateData tutorial</a>. </p> <div class="mw-heading mw-heading3"><h3 id="Worked_example" data-mw-thread-id="h-Worked_example-How_to_use_template_data"><span data-mw-comment-start="" id="h-Worked_example-How_to_use_template_data"></span>Worked example<span data-mw-comment-end="h-Worked_example-How_to_use_template_data"></span></h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Wikipedia:TemplateData/Tutorial&amp;action=edit&amp;section=7" title="Edit section: Worked example"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>The <span class="nowrap">{{</span><a href="/wiki/Template:Str_left" title="Template:Str left">Str left</a><span class="nowrap">}}</span> template is a simple template used like <code>{{Str left|&lt;string>|&lt;count>}}</code> to show the first few characters of an input. It has two parameters, neither of which are named (they are only recognised by their position in the template), and both of which are required. Thus the template data for this template might be: </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="o">&lt;</span><span class="nx">templatedata</span><span class="o">></span> <span class="p">{</span> <span class="w"> </span><span class="s2">"description"</span><span class="o">:</span><span class="w"> </span><span class="s2">"Give the first few characters from the start of the input"</span><span class="p">,</span> <span class="w"> </span><span class="s2">"params"</span><span class="o">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="s2">"1"</span><span class="o">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="s2">"label"</span><span class="o">:</span><span class="w"> </span><span class="s2">"Input"</span><span class="p">,</span> <span class="w"> </span><span class="s2">"description"</span><span class="o">:</span><span class="w"> </span><span class="s2">"The string to be trimmed and counted"</span><span class="p">,</span> <span class="w"> </span><span class="s2">"required"</span><span class="o">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span> <span class="w"> </span><span class="s2">"type"</span><span class="o">:</span><span class="w"> </span><span class="s2">"string"</span> <span class="w"> </span><span class="p">},</span> <span class="w"> </span><span class="s2">"2"</span><span class="o">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="s2">"label"</span><span class="o">:</span><span class="w"> </span><span class="s2">"Length"</span><span class="p">,</span> <span class="w"> </span><span class="s2">"description"</span><span class="o">:</span><span class="w"> </span><span class="s2">"How many characters of the input should be returned"</span><span class="p">,</span> <span class="w"> </span><span class="s2">"required"</span><span class="o">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span> <span class="w"> </span><span class="s2">"type"</span><span class="o">:</span><span class="w"> </span><span class="s2">"number"</span> <span class="w"> </span><span class="p">}</span> <span class="w"> </span><span class="p">}</span> <span class="p">}</span> <span class="o">&lt;</span><span class="err">/templatedata></span> </pre></div> <p>... which would display in the template like so: </p> <section class="mw-templatedata-doc-wrap"><header><p class="mw-templatedata-doc-desc">Give the first few characters from the start of the input</p></header><table class="wikitable mw-templatedata-doc-params sortable"><caption><p class="mw-templatedata-caption">Template parameters</p></caption><thead><tr><th colspan="2">Parameter</th><th>Description</th><th>Type</th><th>Status</th></tr></thead><tbody><tr><th>Input</th><td class="mw-templatedata-doc-param-name"><code>1</code></td><td><p>The string to be trimmed and counted</p><dl></dl></td><td class="mw-templatedata-doc-param-type">String</td><td class="mw-templatedata-doc-param-status-required" data-sort-value="2">required</td></tr><tr><th>Length</th><td class="mw-templatedata-doc-param-name"><code>2</code></td><td><p>How many characters of the input should be returned</p><dl></dl></td><td class="mw-templatedata-doc-param-type">Number</td><td class="mw-templatedata-doc-param-status-required" data-sort-value="2">required</td></tr></tbody></table></section> <p>Note: As explained above, the TemplateData block does not affect how the template works, but it does affect editors' use of the template in the VisualEditor. In the <span class="nowrap">{{</span><a href="/wiki/Template:Str_left" title="Template:Str left">Str left</a><span class="nowrap">}}</span> example above, parameter <code class="tpl-para" style="word-break:break-word;">|2=</code> is listed as "required", which means that the VisualEditor will require entry of a value, even though the template's actual code does not require parameter <code class="tpl-para" style="word-break:break-word;">|2=</code> to be present in transclusions of the template. This difference can be confusing to editors. </p> <div class="mw-heading mw-heading3"><h3 id="Complete_empty_template_data_block" data-mw-thread-id="h-Complete_empty_template_data_block-How_to_use_template_data"><span data-mw-comment-start="" id="h-Complete_empty_template_data_block-How_to_use_template_data"></span>Complete empty template data block<span data-mw-comment-end="h-Complete_empty_template_data_block-How_to_use_template_data"></span></h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Wikipedia:TemplateData/Tutorial&amp;action=edit&amp;section=8" title="Edit section: Complete empty template data block"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>You can just copy and paste this to use when creating your own. </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="o">&lt;</span><span class="nx">templatedata</span><span class="o">></span> <span class="p">{</span> <span class="w"> </span><span class="s2">"description"</span><span class="o">:</span><span class="w"> </span><span class="s2">"zzzzz"</span><span class="p">,</span> <span class="w"> </span><span class="s2">"params"</span><span class="o">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="s2">"first_parameter"</span><span class="o">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="s2">"label"</span><span class="o">:</span><span class="w"> </span><span class="s2">"x"</span><span class="p">,</span> <span class="w"> </span><span class="s2">"description"</span><span class="o">:</span><span class="w"> </span><span class="s2">"xxx"</span><span class="p">,</span> <span class="w"> </span><span class="s2">"required"</span><span class="o">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span> <span class="w"> </span><span class="s2">"suggested"</span><span class="o">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span> <span class="w"> </span><span class="s2">"example"</span><span class="o">:</span><span class="s2">"x"</span><span class="p">,</span> <span class="w"> </span><span class="s2">"deprecated"</span><span class="o">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span> <span class="w"> </span><span class="s2">"aliases"</span><span class="o">:</span><span class="w"> </span><span class="p">[],</span> <span class="w"> </span><span class="s2">"autovalue"</span><span class="o">:</span><span class="w"> </span><span class="s2">"auto value"</span><span class="p">,</span> <span class="w"> </span><span class="s2">"default"</span><span class="o">:</span><span class="w"> </span><span class="s2">"default value"</span><span class="p">,</span> <span class="w"> </span><span class="s2">"type"</span><span class="o">:</span><span class="w"> </span><span class="s2">"string"</span> <span class="w"> </span><span class="p">},</span> <span class="w"> </span><span class="s2">"second_parameter"</span><span class="o">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="s2">"label"</span><span class="o">:</span><span class="w"> </span><span class="s2">"y"</span><span class="p">,</span> <span class="w"> </span><span class="s2">"description"</span><span class="o">:</span><span class="w"> </span><span class="s2">"yyy"</span><span class="p">,</span> <span class="w"> </span><span class="s2">"required"</span><span class="o">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span> <span class="w"> </span><span class="s2">"suggested"</span><span class="o">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span> <span class="w"> </span><span class="s2">"example"</span><span class="o">:</span><span class="w"> </span><span class="s2">"x"</span><span class="p">,</span> <span class="w"> </span><span class="s2">"deprecated"</span><span class="o">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span> <span class="w"> </span><span class="s2">"aliases"</span><span class="o">:</span><span class="w"> </span><span class="p">[],</span> <span class="w"> </span><span class="s2">"autovalue"</span><span class="o">:</span><span class="w"> </span><span class="s2">"auto value"</span><span class="p">,</span> <span class="w"> </span><span class="s2">"default"</span><span class="o">:</span><span class="w"> </span><span class="s2">"default value"</span><span class="p">,</span> <span class="w"> </span><span class="s2">"type"</span><span class="o">:</span><span class="w"> </span><span class="s2">"number"</span> <span class="w"> </span><span class="p">}</span> <span class="w"> </span><span class="p">},</span> <span class="w"> </span><span class="s2">"sets"</span><span class="o">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">}</span> <span class="p">}</span> <span class="o">&lt;</span><span class="err">/templatedata></span> </pre></div> <div class="mw-heading mw-heading3"><h3 id="Shared_documentation" data-mw-thread-id="h-Shared_documentation-How_to_use_template_data"><span data-mw-comment-start="" id="h-Shared_documentation-How_to_use_template_data"></span>Shared documentation<span data-mw-comment-end="h-Shared_documentation-How_to_use_template_data"></span></h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Wikipedia:TemplateData/Tutorial&amp;action=edit&amp;section=9" title="Edit section: Shared documentation"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Many templates share the same documentation. Putting template data on a subpage has the advantage that the documentation page is generally not protected so all editors can update the documentation. However, if the template data is included in a shared documentation page then this will cause some of the templates to pick up the wrong template data section. </p><p>This can be resolved by putting the template data in an individual subpage (<a href="/wiki/Template:Col-begin/doc" title="Template:Col-begin/doc">Template:col-begin/doc</a> uses <a href="/wiki/Template:Col-begin/TemplateData" title="Template:Col-begin/TemplateData">Template:Col-begin/TemplateData</a>) or in the template page itself (as in <span class="nowrap">{{</span><a href="/wiki/Template:Collapse_top" title="Template:Collapse top">collapse top</a><span class="nowrap">}}</span>). An alternative technique is to use <a href="/wiki/Wikipedia:Switch" class="mw-redirect" title="Wikipedia:Switch"><code>{{#switch: {{PAGENAME}} | ...}}</code></a> in the document page with the different <code>&lt;templatedata></code> sections in each switch block. </p> <div class="mw-heading mw-heading3"><h3 id="Help" data-mw-thread-id="h-Help-How_to_use_template_data"><span data-mw-comment-start="" id="h-Help-How_to_use_template_data"></span>Help<span data-mw-comment-end="h-Help-How_to_use_template_data"></span></h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Wikipedia:TemplateData/Tutorial&amp;action=edit&amp;section=10" title="Edit section: Help"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Should you run into errors, explain on the <a href="/wiki/Wikipedia:VisualEditor/Feedback" title="Wikipedia:VisualEditor/Feedback">feedback page</a> what you were trying to do, and we'll be happy to help. </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="Examples" data-mw-thread-id="h-Examples"><span data-mw-comment-start="" id="h-Examples"></span>Examples<span data-mw-comment-end="h-Examples"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Wikipedia:TemplateData/Tutorial&amp;action=edit&amp;section=11" title="Edit section: Examples"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-Examples","replies":[]}}--></div> <p>A template which takes no parameters: <span class="nowrap">{{</span><a href="/wiki/Template:Fixed" title="Template:Fixed">fixed</a><span class="nowrap">}}</span>. Note the params must be given as an empty list. </p> <table style="margin-top:0;margin-left:0; border-width:medium; padding:0;"> <tbody><tr> <th scope="col" style="width:50%;">Markup</th> <th scope="col" style="width:50%;">Renders as </th></tr> <tr> <td style="background:#f8f9fa; background:var(--background-color-interactive-subtle, #f8f9fa); color:var(--color-base, #000); border:1px solid #eaecf0; padding:9px 5px 5px; vertical-align:top;"><pre style="margin:0; border:none; padding:0; word-wrap:break-word; white-space:-moz-pre-wrap; white-space:-o-pre-wrap; white-space:-pre-wrap; white-space:pre-wrap; ">&lt;templatedata>{ "description": "Displays a tick mark and the word fixed. It takes no parameters.", "params": { } }&lt;/templatedata> </pre> </td> <td style="background:#f8f9fa; background:var(--background-color-interactive-subtle, #f8f9fa); color:var(--color-base, #000); border:1px solid #eaecf0; padding:5px; vertical-align:top;"><div style=""> <section class="mw-templatedata-doc-wrap"><header><p class="mw-templatedata-doc-desc">Displays a tick mark and the word fixed. It takes no parameters.</p></header><table class="wikitable mw-templatedata-doc-params"><caption><p class="mw-templatedata-caption">Template parameters</p></caption><thead><tr><th colspan="2">Parameter</th><th>Description</th><th>Type</th><th>Status</th></tr></thead><tbody><tr><td class="mw-templatedata-doc-muted" colspan="7">No parameters specified</td></tr></tbody></table></section> </div> </td></tr> <tr> <td style="border-width:1px;border-style: none none none;border-color:#ddd; padding:5px; vertical-align:top;"> </td> <td style="border-width:1px;border-style: none none none;border-color:#ddd; padding:5px; vertical-align:top;"> </td></tr></tbody></table> <p>A template with aliases <span class="nowrap">{{</span><a href="/wiki/Template:Quote" class="mw-redirect" title="Template:Quote">quote</a><span class="nowrap">}}</span>: </p> <table style="margin-top:0;margin-left:0; border-width:medium; padding:0;"> <tbody><tr> <th scope="col" style="width:50%;">Markup</th> <th scope="col" style="width:50%;">Renders as </th></tr> <tr> <td style="background:#f8f9fa; background:var(--background-color-interactive-subtle, #f8f9fa); color:var(--color-base, #000); border:1px solid #eaecf0; padding:9px 5px 5px; vertical-align:top;"><pre style="margin:0; border:none; padding:0; word-wrap:break-word; white-space:-moz-pre-wrap; white-space:-o-pre-wrap; white-space:-pre-wrap; white-space:pre-wrap; ">&lt;templatedata>{ "description": "Adds a block quotation.", "params": { "text": { "label": "text", "description": "The text to quote", "type": "string", "required": false, "aliases": [ "1", "quote" ] }, "sign": { "label": "sign", "description": "The person who quote it is", "type": "string", "required": false, "aliases": [ "2", "cite" ] }, "source": { "label": "source", "description": "A source for the quote", "type": "string", "required": false, "aliases": [ "3" ] } } }&lt;/templatedata></pre> </td> <td style="background:#f8f9fa; background:var(--background-color-interactive-subtle, #f8f9fa); color:var(--color-base, #000); border:1px solid #eaecf0; padding:5px; vertical-align:top;"><div style=""> <section class="mw-templatedata-doc-wrap"><header><p class="mw-templatedata-doc-desc">Adds a block quotation.</p></header><table class="wikitable mw-templatedata-doc-params sortable"><caption><p class="mw-templatedata-caption">Template parameters</p></caption><thead><tr><th colspan="2">Parameter</th><th>Description</th><th>Type</th><th>Status</th></tr></thead><tbody><tr><th>text</th><td class="mw-templatedata-doc-param-name"><code>text</code> <code class="mw-templatedata-doc-param-alias">1</code> <code class="mw-templatedata-doc-param-alias">quote</code></td><td><p>The text to quote</p><dl></dl></td><td class="mw-templatedata-doc-param-type">String</td><td class="mw-templatedata-doc-param-status-optional" data-sort-value="0">optional</td></tr><tr><th>sign</th><td class="mw-templatedata-doc-param-name"><code>sign</code> <code class="mw-templatedata-doc-param-alias">2</code> <code class="mw-templatedata-doc-param-alias">cite</code></td><td><p>The person who quote it is</p><dl></dl></td><td class="mw-templatedata-doc-param-type">String</td><td class="mw-templatedata-doc-param-status-optional" data-sort-value="0">optional</td></tr><tr><th>source</th><td class="mw-templatedata-doc-param-name"><code>source</code> <code class="mw-templatedata-doc-param-alias">3</code></td><td><p>A source for the quote</p><dl></dl></td><td class="mw-templatedata-doc-param-type">String</td><td class="mw-templatedata-doc-param-status-optional" data-sort-value="0">optional</td></tr></tbody></table></section> </div> </td></tr> <tr> <td style="border-width:1px;border-style: none none none;border-color:#ddd; padding:5px; vertical-align:top;"> </td> <td style="border-width:1px;border-style: none none none;border-color:#ddd; padding:5px; vertical-align:top;"> </td></tr></tbody></table> <p>A template with default values <span class="nowrap">{{</span><a href="/w/index.php?title=Template:Col-6&amp;action=edit&amp;redlink=1" class="new" title="Template:Col-6 (page does not exist)">col-6</a><span class="nowrap">}}</span>. Note default values are the values used by a template when the parameter is not specified. This example uses the <code>"format": "block"</code> option. </p> <table style="margin-top:0;margin-left:0; border-width:medium; padding:0;"> <tbody><tr> <th scope="col" style="width:50%;">Markup</th> <th scope="col" style="width:50%;">Renders as </th></tr> <tr> <td style="background:#f8f9fa; background:var(--background-color-interactive-subtle, #f8f9fa); color:var(--color-base, #000); border:1px solid #eaecf0; padding:9px 5px 5px; vertical-align:top;"><pre style="margin:0; border:none; padding:0; word-wrap:break-word; white-space:-moz-pre-wrap; white-space:-o-pre-wrap; white-space:-pre-wrap; white-space:pre-wrap; ">&lt;templatedata> { "description": "Starts a new column, for use with {{col-begin}} when there are six columns.", "params": { "width": { "label": "width", "description": "Width of the column.", "type": "string", "default": "16.66%", "aliases": ["w"], "required": false }, "align": { "label": "align", "description": "Horizontal alignment.", "type": "string", "default": "left", "required": false }, "valign": { "label": "valign", "description": "Vertical alignment.", "default": "top", "type": "string", "required": false } }, "format": "block" } &lt;/templatedata></pre> </td> <td style="background:#f8f9fa; background:var(--background-color-interactive-subtle, #f8f9fa); color:var(--color-base, #000); border:1px solid #eaecf0; padding:5px; vertical-align:top;"><div style=""> <section class="mw-templatedata-doc-wrap"><header><p class="mw-templatedata-doc-desc">Starts a new column, for use with {{col-begin}} when there are six columns.</p></header><table class="wikitable mw-templatedata-doc-params sortable"><caption><p class="mw-templatedata-caption">Template parameters</p><p><span class="oo-ui-widget oo-ui-widget-enabled oo-ui-iconElement-icon oo-ui-icon-template-format-block oo-ui-iconElement oo-ui-labelElement-invisible oo-ui-iconWidget"></span><span class="mw-templatedata-format">This template prefers block formatting of parameters.</span></p></caption><thead><tr><th colspan="2">Parameter</th><th>Description</th><th>Type</th><th>Status</th></tr></thead><tbody><tr><th>width</th><td class="mw-templatedata-doc-param-name"><code>width</code> <code class="mw-templatedata-doc-param-alias">w</code></td><td><p>Width of the column.</p><dl><dt>Default</dt><dd>16.66%</dd></dl></td><td class="mw-templatedata-doc-param-type">String</td><td class="mw-templatedata-doc-param-status-optional" data-sort-value="0">optional</td></tr><tr><th>align</th><td class="mw-templatedata-doc-param-name"><code>align</code></td><td><p>Horizontal alignment.</p><dl><dt>Default</dt><dd>left</dd></dl></td><td class="mw-templatedata-doc-param-type">String</td><td class="mw-templatedata-doc-param-status-optional" data-sort-value="0">optional</td></tr><tr><th>valign</th><td class="mw-templatedata-doc-param-name"><code>valign</code></td><td><p>Vertical alignment.</p><dl><dt>Default</dt><dd>top</dd></dl></td><td class="mw-templatedata-doc-param-type">String</td><td class="mw-templatedata-doc-param-status-optional" data-sort-value="0">optional</td></tr></tbody></table></section> </div> </td></tr> <tr> <td style="border-width:1px;border-style: none none none;border-color:#ddd; padding:5px; vertical-align:top;"> </td> <td style="border-width:1px;border-style: none none none;border-color:#ddd; padding:5px; vertical-align:top;"> </td></tr></tbody></table> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="Limitations_and_questions" data-mw-thread-id="h-Limitations_and_questions"><span data-mw-comment-start="" id="h-Limitations_and_questions"></span>Limitations and questions<span data-mw-comment-end="h-Limitations_and_questions"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Wikipedia:TemplateData/Tutorial&amp;action=edit&amp;section=12" title="Edit section: Limitations and questions"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-Limitations_and_questions","replies":[]}}--></div> <p>Template data is great for editing existing templates, but does not currently automatically pull in parameters when you create a new template. The ability to have it do that is being worked on now. There is some delay between the implementation and it showing up in existing templates – which makes debugging slightly difficult. There is also a slight delay after template data is created before it appears in the VisualEditor. </p><p>Template data was previously limited to 65,535 bytes (Phabricator: <s><a href="https://phabricator.wikimedia.org/T53740" class="extiw" title="phabricator:T53740">T53740</a></s>). This limit could be exceeded for some templates which use many parameters, such as <span class="nowrap">{{</span><a href="/wiki/Template:Infobox_officeholder" title="Template:Infobox officeholder">Infobox officeholder</a><span class="nowrap">}}</span>, but the code is now compressed, increasing the limit. </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="Tools" data-mw-thread-id="h-Tools"><span data-mw-comment-start="" id="h-Tools"></span>Tools<span data-mw-comment-end="h-Tools"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Wikipedia:TemplateData/Tutorial&amp;action=edit&amp;section=13" title="Edit section: Tools"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-Tools","replies":[]}}--></div> <figure class="mw-default-size" typeof="mw:File/Thumb"><a href="/wiki/File:TemplateDataEditor.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/a/a1/TemplateDataEditor.png/220px-TemplateDataEditor.png" decoding="async" width="220" height="120" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/a/a1/TemplateDataEditor.png/330px-TemplateDataEditor.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/a/a1/TemplateDataEditor.png/440px-TemplateDataEditor.png 2x" data-file-width="1410" data-file-height="772"/></a><figcaption>Editor for <a href="/wiki/Wikipedia:VisualEditor/TemplateData" class="mw-redirect" title="Wikipedia:VisualEditor/TemplateData">template data</a></figcaption></figure> <ul><li><a href="/wiki/User:NicoV/TemplateDataEditor" title="User:NicoV/TemplateDataEditor">TemplateDataEditor</a> A user script that makes the process of adding template data easier.</li> <li><a rel="nofollow" class="external text" href="http://tools.wikimedia.pl/~mlazowik/templatedata/?lang=en">Yet another template data editor</a></li> <li><a href="/wiki/User:Salix_alba/TDSkell" title="User:Salix alba/TDSkell">TemplateData Skeleton</a> — Read the source of a template and tries to find all the parameters used and output a skeleton document with all the parameters listed. Javascript toolbox popup.</li> <li><a href="/wiki/Module:TemplateDataGenerator" title="Module:TemplateDataGenerator">Module:TemplateDataGenerator‎</a> – Skeleton generator as a template to subst.</li> <li><span class="nowrap">{{</span><a href="/wiki/Template:Format_TemplateData" title="Template:Format TemplateData">Format TemplateData</a><span class="nowrap">}}</span> (which uses <a href="/wiki/Module:Format_TemplateData" title="Module:Format TemplateData">Module:Format TemplateData</a>) help format the appearance of template data sections on documentation pages.</li> <li><a href="https://ru.wikipedia.org/wiki/%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:TemplateDataDoc" class="extiw" title="ru:Модуль:TemplateDataDoc">ru:Модуль:TemplateDataDoc</a> allows to create blank copy and usage example from template data. The module is in Russian.</li></ul> <p>== </p> <ul><li><a rel="nofollow" class="external text" href="http://jsonlint.com/">Jsonlint</a> a JSON validator to help spot errors in the template data syntax.</li></ul> <!-- NewPP limit report Parsed by mw‐web.codfw.main‐75bcdb9b47‐mn4xk Cached time: 20241101023506 Cache expiry: 2582701 Reduced expiry: true Complications: [vary‐revision‐sha1, show‐toc] DiscussionTools time usage: 0.032 seconds CPU time usage: 0.274 seconds Real time usage: 0.675 seconds Preprocessor visited node count: 2313/1000000 Post‐expand include size: 17507/2097152 bytes Template argument size: 1655/2097152 bytes Highest expansion depth: 9/100 Expensive parser function count: 7/500 Unstrip recursion depth: 0/20 Unstrip post‐expand size: 17452/5000000 bytes Lua time usage: 0.101/10.000 seconds Lua memory usage: 2488081/52428800 bytes Number of Wikibase entities loaded: 0/400 --> <!-- Transclusion expansion time report (%,ms,calls,template) 100.00% 571.324 1 -total 16.24% 92.786 3 Template:Markup 14.88% 85.012 3 Template:For_loop 9.42% 53.840 1 Template:Short_description 9.01% 51.505 60 Template:Item 7.74% 44.225 1 Template:VisualEditor_navbox 6.62% 37.839 1 Template:Pagetype 6.60% 37.700 1 Template:Shortcut 3.32% 18.993 1 Template:See_also 1.25% 7.121 11 Template:Tl --> <!-- Saved in parser cache with key enwiki:pcache:idhash:39784750-0!canonical and timestamp 20241101023506 and revision id 1224100297. Rendering was triggered because: page-view --> </div><!--esi <esi:include src="/esitest-fa8a495983347898/content" /> --><noscript><img src="https://login.wikimedia.org/wiki/Special:CentralAutoLogin/start?type=1x1" alt="" width="1" height="1" style="border: none; position: absolute;"></noscript> <div class="printfooter" data-nosnippet="">Retrieved from "<a dir="ltr" href="https://en.wikipedia.org/w/index.php?title=Wikipedia:TemplateData/Tutorial&amp;oldid=1224100297">https://en.wikipedia.org/w/index.php?title=Wikipedia:TemplateData/Tutorial&amp;oldid=1224100297</a>"</div></div> <div id="catlinks" class="catlinks" data-mw="interface"><div id="mw-normal-catlinks" class="mw-normal-catlinks"><a href="/wiki/Help:Category" title="Help:Category">Categories</a>: <ul><li><a href="/wiki/Category:TemplateData" title="Category:TemplateData">TemplateData</a></li><li><a href="/wiki/Category:Wikipedia_template_help" title="Category:Wikipedia template help">Wikipedia template help</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 16 May 2024, at 07:20<span class="anonymous-show">&#160;(UTC)</span>.</li> <li id="footer-info-copyright">Text is available under the <a href="/wiki/Wikipedia:Text_of_the_Creative_Commons_Attribution-ShareAlike_4.0_International_License" title="Wikipedia:Text of the Creative Commons Attribution-ShareAlike 4.0 International License">Creative Commons Attribution-ShareAlike 4.0 License</a>; additional terms may apply. By using this site, you agree to the <a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Terms_of_Use" class="extiw" title="foundation:Special:MyLanguage/Policy:Terms of Use">Terms of Use</a> and <a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Privacy_policy" class="extiw" title="foundation:Special:MyLanguage/Policy:Privacy policy">Privacy Policy</a>. Wikipedia® is a registered trademark of the <a rel="nofollow" class="external text" href="https://wikimediafoundation.org/">Wikimedia Foundation, Inc.</a>, a non-profit organization.</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/Wikipedia:About">About Wikipedia</a></li> <li id="footer-places-disclaimers"><a href="/wiki/Wikipedia:General_disclaimer">Disclaimers</a></li> <li id="footer-places-contact"><a href="//en.wikipedia.org/wiki/Wikipedia:Contact_us">Contact Wikipedia</a></li> <li id="footer-places-wm-codeofconduct"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Universal_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/#/en.wikipedia.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="//en.m.wikipedia.org/w/index.php?title=Wikipedia:TemplateData/Tutorial&amp;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" loading="lazy"></a></li> <li id="footer-poweredbyico"><a href="https://www.mediawiki.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/w/resources/assets/poweredby_mediawiki.svg" alt="Powered by MediaWiki" width="88" height="31" loading="lazy"></a></li> </ul> </footer> </div> </div> </div> <div class="vector-settings" id="p-dock-bottom"> <ul></ul> </div><script>(RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgHostname":"mw-web.codfw.main-57488d5c7d-75bsd","wgBackendResponseTime":179,"wgDiscussionToolsPageThreads":[{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-How_to_use_template_data","replies":[{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-The_structure_of_template_data-How_to_use_template_data","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-Template_data-How_to_use_template_data","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-Identifying_the_parameters-How_to_use_template_data","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-Completing_the_template_data_information-How_to_use_template_data","replies":[{"headingLevel":4,"name":"h-","type":"heading","level":0,"id":"h-Save-Completing_the_template_data_information","replies":[]}]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-Worked_example-How_to_use_template_data","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-Complete_empty_template_data_block-How_to_use_template_data","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-Shared_documentation-How_to_use_template_data","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-Help-How_to_use_template_data","replies":[]}]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-Examples","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-Limitations_and_questions","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-Tools","replies":[]}],"wgPageParseReport":{"discussiontools":{"limitreport-timeusage":"0.032"},"limitreport":{"cputime":"0.274","walltime":"0.675","ppvisitednodes":{"value":2313,"limit":1000000},"postexpandincludesize":{"value":17507,"limit":2097152},"templateargumentsize":{"value":1655,"limit":2097152},"expansiondepth":{"value":9,"limit":100},"expensivefunctioncount":{"value":7,"limit":500},"unstrip-depth":{"value":0,"limit":20},"unstrip-size":{"value":17452,"limit":5000000},"entityaccesscount":{"value":0,"limit":400},"timingprofile":["100.00% 571.324 1 -total"," 16.24% 92.786 3 Template:Markup"," 14.88% 85.012 3 Template:For_loop"," 9.42% 53.840 1 Template:Short_description"," 9.01% 51.505 60 Template:Item"," 7.74% 44.225 1 Template:VisualEditor_navbox"," 6.62% 37.839 1 Template:Pagetype"," 6.60% 37.700 1 Template:Shortcut"," 3.32% 18.993 1 Template:See_also"," 1.25% 7.121 11 Template:Tl"]},"scribunto":{"limitreport-timeusage":{"value":"0.101","limit":"10.000"},"limitreport-memusage":{"value":2488081,"limit":52428800}},"cachereport":{"origin":"mw-web.codfw.main-75bcdb9b47-mn4xk","timestamp":"20241101023506","ttl":2582701,"transientcontent":true}}});});</script> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10