Wikipedia:TemplateData/Tutorial: Difference between revisions
Content deleted Content added
m clean up |
|||
Line 39:
If the template has no parameters, you can complete its TemplateData 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 TemplateData for the template.
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><nowiki>{{cite web}}</nowiki></code> template is passed values to complete a citation, such as <code>url=</code>, <code>title=</code>, <code>
The [[Wikipedia:Template documentation|template documentation]] on the main or sub-page may summarize which parameters can be set on a template, and what each parameter must include. Also, TemplateDate must be included in the template documentation page.
Line 92:
|-
|<code>"unbalanced-wikitext"</code>
|Raw wikitext that should not be treated as standalone content because it is unbalanced
|-
|<code>"date"</code>
Line 380:
== Limitations and questions ==
TemplateData 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
Template data was previously limited to 65,535 bytes (Phabricator: <s>{{phab|53740}}</s>). This limit could be exceeded for some templates which use many parameters, such as {{tl|Infobox officeholder}}, but the code is now compressed, increasing the limit.
Line 389:
* [http://tools.wikimedia.pl/~mlazowik/templatedata/?lang=en Yet another template data editor]
* [[User:Salix alba/TDSkell|TemplateData Skeleton]] — 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.
* [[Module:TemplateDataGenerator]]
* {{tl|Format TemplateData}} and [[Module:TemplateData]] help format the appearance of template data sections on documentation pages.
* [[:ru:Модуль:TemplateDataDoc]] allows to create blank copy and usage example from TemplateData. The module is in Russian.
|