Last modified: 2014-07-09 10:46:59 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T69677, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 67677 - TemplateData: Allow templates to inherit/share TemplateData from/with other templates where multiple templates share identical parameters
TemplateData: Allow templates to inherit/share TemplateData from/with other t...
Status: ASSIGNED
Product: MediaWiki extensions
Classification: Unclassified
TemplateData (Other open bugs)
unspecified
All All
: High enhancement (vote)
: ---
Assigned To: Editing team bugs – take if you're interested!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-07-08 17:27 UTC by WhatamIdoing
Modified: 2014-07-09 10:46 UTC (History)
8 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description WhatamIdoing 2014-07-08 17:27:29 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.
Comment 1 Makyen 2014-07-08 21:51:47 UTC
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.
Comment 2 Makyen 2014-07-08 21:54:00 UTC
I failed to remove the wikitext from the {{#tag}} example.  It should have been:
{{#tag:templatedata|Your templates here}}.
Comment 3 James Forrester 2014-07-09 00:03:35 UTC
(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.
Comment 4 Helder 2014-07-09 00:50:11 UTC
(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
Comment 5 Richard Morris 2014-07-09 02:07:06 UTC
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.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links