Page MenuHomePhabricator

TemplateData: Allow templates to inherit/share TemplateData from/with other templates where multiple templates share identical parameters
Open, MediumPublicFeature

Description

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.


Version: unspecified
Severity: enhancement

Details

Reference
bz67677

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 3:26 AM
bzimport added a project: TemplateData.
bzimport set Reference to bz67677.

wp.makyen wrote:

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.

wp.makyen wrote:

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.

Jdforrester-WMF lowered the priority of this task from High to Medium.Nov 16 2015, 9:34 PM
Jdforrester-WMF set Security to None.

This is stalled on a proposal for how this would work in a way that makes sense.

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 12:23 PM
Aklapper removed a subscriber: TrevorParscal.