Page MenuHomePhabricator

Add TemplateData means to appropiate namespaces for using a template (Don't suggest "meta" templates on articles)
Open, LowPublicFeature

Description

Intention:
I wanted to help a new user to find a template to add a reference to an article.

Steps to Reproduce:

  1. The user was already using Visual Editor. So, suppose we clicked in the link

https://pt.wikipedia.org/wiki/Special:Random?veaction=edit&uselang=en

  1. I instructed the user to open the transclusion interface (More > Transclusion)
  2. Since I knew the name of our citation templates, I suggested the user to type "citar livro" in the "New template" field

Actual Results:
Visual Editor displayed a list of possible matches, containing the following templates:

  • Citar livro
  • Citar livro/doc
  • Citar livro/autor
  • Citar livro/coautores
  • Citar livro/dados
  • Citar livro/coautores/doc
  • Citar livro/ref

Of these, only the first one is supposed to be used in the articles. The others are just auxiliary templates (meta-templates), used by the main one. But new users do not know that, and get confused by this!

Expected Results:
Visual Editor should provide only the options which are useful.

Reproducible: Didn't try

A possible solution for this would be the addition of a new property to the template data, to allow template authors to document certain templates with "auxiliary: true". Then Visual Editor could filter its current search results to show only templates satisfying "auxiliary: false".


Version: unspecified
Severity: enhancement

Details

Reference
bz56516

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:32 AM
bzimport set Reference to bz56516.
Deskana lowered the priority of this task from Medium to Low.May 3 2018, 8:15 AM

Not exactly. If we were to have a way to mark a template as "meta" (e.g. "only use inside another template, not on articles"), we could not use that technique to hide "/doc" from the list of templates because the "/doc" page is transcluded to the actual template, and thus would always have the same TemplateData properties.

Krinkle renamed this task from VisualEditor: In transclusion dialog, only suggest templates intended for use in that namespace (e.g. suppress meta-templates from content namespaces) to Add TemplateData means to appropiate namespaces for using a template (Don't suggest "meta" templates on articles).Jul 14 2018, 11:03 PM
Krinkle added a project: TemplateData.
Krinkle added subscribers: TheDJ, Wostr, Whatamidoing-WMF and 5 others.

Not totally certain I like the boolean; it might be more useful to specify which namespaces (probably by namespace identifier) instead. Or possibly using the notions of content, subject, and talk spaces.

The issue identified by Krinkle is rough, since it's not only /doc but also /sandbox that will catch.

A different direction would be some sort of MediaWiki namespace page with a list of titles not to suggest with simple regex like with MediaWiki:Spam-blacklist. It's mostly /testcases, /doc, /sandbox we're talking about here I suspect. Not as modular to the specific templates but those are the predominant issue templates for most wikis these days, I imagine, and others can be added ad hoc to the same list.

It looks like VE is doing this for /doc pages but it's pretty rigid, see T54448.

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 11:13 AM