Feature summary:
Add a method field to TemplateData to specify whether a template is intended to be transcluded, substituted, or either. For example:
"method": "substitution preferred"
Possible values could include:
- "any" (default)
- "substitution preferred"
- "substitution only"
- "transclusion preferred"
- "transclusion only"
Use case(s):
Some templates are designed primarily for substitution, while others are intended only for transclusion. There are also templates that support both, but where one method is preferred over the other.
At present, TemplateData can describe a template's parameters and other metadata, but it cannot indicate the intended method of use. As a result, tools that consume TemplateData (such as VisualEditor) have no way to guide users towards the recommended behaviour or to prevent unsupported usage.
Adding a method field would allow template authors to express this information in a machine-readable way.
Benefits:
This would enable editing tools to provide better guidance to users, reduce accidental misuse of templates, and improve consistency across projects. It would also make TemplateData a more complete description of how a template is intended to be used, allowing clients to distinguish between recommendations ("preferred") and actual restrictions ("only").