Wikipedia:TemplateData/Tutorial: Difference between revisions
Content deleted Content added
Salix alba (talk | contribs) add a link to a json validator |
Salix alba (talk | contribs) →Limitations and questions: give examples of special cases |
||
Line 149:
===Help===
Should you run into errors, explain on the [[Wikipedia:VisualEditor/Feedback|feedback page]] what you were trying to do, and we'll be happy to help.
== Examples ==
A template which takes no parameters: {{t1|fixed}}. Note the params must be give as an empty list.
{{markup |
<nowiki>
<templatedata>{
"description": "Displays a tick mark and the word fixed. It takes no parameters.",
"params": { }
}</templatedata>
</nowiki>
|
<templatedata>{
"description": "Displays a tick mark and the word fixed. It takes no parameters.",
"params": { }
}</templatedata>
}}
A template with aliases {{t1|quote}}:
{{markup|
<nowiki>
<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" ]
}
}
}</templatedata></nowiki>
|
<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" ]
}
}
}</templatedata>
}}
== Limitations and questions ==
|