Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Tld/doc: Difference between revisions

Template page
TemplateData: Add TemplateData documentation for the `class` parameter
+/doc
 
Line 1: Line 1:
{{Documentation subpage}}
<!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata -->
{{Uses TemplateStyles|Template:Mono/styles.css|Template:Nowrap/styles.css}}
This is the {{tld|tld}} template.
This template works almost exactly like {{tlc|tlc}}, see  [[Template:Tlc|full documentation]] there.
But here is a short example:
<pre>
{{tld|template name|parameters}}
</pre>
Renders like this:
:{{tld|template name|parameters}}
== TemplateData ==
== TemplateData ==
{{TemplateData header}}
{{TemplateData header}}
Line 76: Line 61:
"description": "Whether to add “<span style=\"white-space: nowrap\">”",
"description": "Whether to add “<span style=\"white-space: nowrap\">”",
"autovalue": "1",
"autovalue": "1",
"type": "boolean"
},
"doc": {
"label": "doc",
"description": "Whether to display a linked “+/doc”",
"type": "boolean"
"type": "boolean"
}
}
Line 81: Line 71:
"paramOrder": [
"paramOrder": [
"class",
"class",
"doc",
"nowrap",
"nowrap",
"1",
"1",

Latest revision as of 04:20, 22 February 2024

TemplateData

<templatedata>JSON</templatedata> ./. {{TemplateBox}}
TemplateData

TemplateData is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by VisualEditor and possibly other tools like Upload Wizard.


Existing template documentation
At Wikimedia Commons, it is recommended to use {{TemplateBox}} with either ‎useTemplateData=1 or ‎useTemplateData=only on the ‎/doc subpage and transcluding it with {{Documentation}} into the template. ‎<nowiki>-tags can be wrapped around the arguments, if required, to avoid templates being expanded.

Newly created template documentation and imports
Another option, especially for imported templates, or for users with JSON experience, is placing raw ‎<templatedata>-tags into the Wikitext of the template, as described in various Wikipediae.


Wikipedia's help about TemplateDataCommons-specific information

Template link code with link

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Extra Class Namesclass

Extra class names to add to the “class” attribute.

Stringoptional
docdoc

Whether to display a linked “+/doc”

Booleanoptional
Nowrap?nowrap

Whether to add “<span style="white-space: nowrap">”

Auto value
1
Booleanoptional
Template1

Linked template name

Templaterequired
Parameter 12

First parameter value

Stringoptional
Parameter 23

Second parameter value

Stringoptional
Parameter 34

Third parameter value

Stringoptional
Parameter 45

Fourth parameter value

Stringoptional
Parameter 56

Fifth parameter value

Stringoptional
Parameter 67

Sixth parameter value

Stringoptional
Parameter 78

Seventh parameter value

Stringoptional
Parameter 89

Eighth parameter value

Stringoptional
  1. REDIRECT Commons:Link templates/Template links
Cookies help us deliver our services. By using our services, you agree to our use of cookies.