Last modified: 2014-07-09 10:46:59 UTC
When several templates have identical parameters, it should be possible to place TemplateData in a template and transclude it onto the template's documentation. For example, most of the barnstars use the same underlying structure, and so have all the same parameters. It would be convenient to manage that TemplateData centrally, rather than having to copy it (and maintain it) on dozens of pages.
You can use templates to translude portions of the TemplateData JSON object. You do have to use something like {{((}}#tag:templatedata|Your templates here}}. I have set up an example at https://en.wikipedia.org/wiki/Template:Ref_supports. The resulting TemplateData can be seen at https://en.wikipedia.org/w/api.php?action=templatedata&titles=Template:Ref_supports/doc&format=jsonfm. The example transcludes separate portions of the template data JSON from 5 subpages onto the Ref supports/doc page which is then transcluded, using {{documentation}}, onto the template page.
I failed to remove the wikitext from the {{#tag}} example. It should have been: {{#tag:templatedata|Your templates here}}.
(In reply to Makyen from comment #2) > I failed to remove the wikitext from the {{#tag}} example. It should have > been: > {{#tag:templatedata|Your templates here}}. If you're using #tag to do something, that's generally a really strong sign that you shouldn't be doing it at all. :-) In this case, that completely and utterly breaks any chance of using a proper tool to edit the TemplateData, and won't survive the content being transferred to its own JSON-only namespace.
(In reply to James Forrester from comment #3) > ... > and won't survive the content being transferred to its own JSON-only > namespace. aka bug 54140
I'm not quite sure if this is quite whats wanted but there are already some templates which share the same TemplateData documentation http://en.wikipedia.org/wiki/Template:Yes http://en.wikipedia.org/wiki/Template:No and related all share http://en.wikipedia.org/wiki/Template:Table_cell_templates/doc which has a template data section. These share the whole block which is worded to be applicable to all of the templates.