Page MenuHomePhabricator

Please support sharing TemplateData among multiple templates
Closed, DuplicatePublic

Description

Some templates have exactly the same TemplateData parameters. For example, a wiki might have 10 different templates for displaying a message box: Template:Note, Template:Warning, Template:Tip, etc. Other templates have very similar, but not identical TemplateData-- say, the same parameters but different defaults.

Rather than create duplicate <templatedata> blocks for each template, it would be great to create a single <templatedata> block that all the templates share. I realize you could do this by transcluding the same block into multiple templates, but that's tricky for several reasons:

  • I suspect the GUI TemplateData editor won't recognize the transclusion. The TemplateData development team has expressed that they don't want to perform additional wikitext parsing (see T124338), and I don't blame them.
  • <templatedata> blocks are generally surrounded by <noinclude>, so there are limits to how much transclusion you can do.
  • Two templates with the same params information most likely have different description information. So how do you share just the params between templates?

There are various ways that each author can dream up to accomplish sharing... but what's the best way? Is there a recommended way that will work best with future versions of TemplateData? Please provide guidance -- or direct software support -- for the best practices for templates to share documentation.

Event Timeline

maiden_taiwan raised the priority of this task from to Needs Triage.
maiden_taiwan updated the task description. (Show Details)
maiden_taiwan added a project: TemplateData.
maiden_taiwan subscribed.
Jdforrester-WMF renamed this task from Please support, or document a best practice, for sharing TemplateData among multiple templates to Please support sharing TemplateData among multiple templates.Apr 19 2016, 7:24 PM
Jdforrester-WMF triaged this task as Lowest priority.
Jdforrester-WMF added a project: Epic.
Jdforrester-WMF set Security to None.