Last modified: 2014-10-08 17:24:17 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 T53428, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 51428 - TemplateData: Add an "autofill" attribute for parameters which clients would automatically insert if none specified
TemplateData: Add an "autofill" attribute for parameters which clients would ...
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
TemplateData (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Moriel Schottlender
:
: 52028 (view as bug list)
Depends on:
Blocks: 52029
  Show dependency treegraph
 
Reported: 2013-07-16 07:31 UTC by NicoV
Modified: 2014-10-08 17:24 UTC (History)
9 users (show)

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


Attachments

Description NicoV 2013-07-16 07:31:46 UTC
In addition to the existing "default" attribute for each template parameter, that would be useful to have an "autofill" attribute for each template parameter:
* "default" is the value that will be used by the template if the parameter is not specified
* "autofill" could be used for indicating that when inserting a template in a article with VE (or other editor), some parameters should be created automatically with a given value.

I think for example of some templates that have a date parameter to be filled with the date at which the template was inserted.
Comment 1 James Forrester 2013-07-22 15:43:33 UTC
This seems like a nice improvement, though I worry that it sets up an expectation that a client may not honour.
Comment 2 Chris McKenna 2013-07-30 11:24:26 UTC
*** Bug 52028 has been marked as a duplicate of this bug. ***
Comment 3 Chris McKenna 2013-07-30 11:26:01 UTC
From Bug 52028:
TemplateData should allow some parameters to have default values which are
prefilled when using the VisualEditor transclusion manager. 

An example would be the current date for accessdate in citation templates.
Comment 4 Quiddity 2013-09-12 02:25:53 UTC
I almost submitted a new bug, but saw this one in the "possible duplicates" at the last second... Pasting the text I wrote, in case it helps:


Most cleanup templates, banner and inline, have a "|date={{CURRENTMONTHNAME}} {{CURRENTYEAR}}" parameter.

If we don't add them, then (on En.Wiki) AnomieBot adds them a few minutes later*, which clutters the history, and more importantly Buries the initial edit in watchlists, making it harder for us humans to check.

*eg. https://en.wikipedia.org/w/index.php?title=Red_squirrel&curid=638291&diff=572563931&oldid=572553559


Could we have an "Add current month and year" button, for parameters like this?

Or, a tweak for TemplateData so that specific templates will add this parameter/value by default?
Comment 5 Krinkle 2014-05-20 20:16:18 UTC
This is generally worked around by wikis by providing another template that when substituted inserts the autofill parameters.

e.g.

{{subst:newdelete|reason=Foo}}
-> 
{{delete|reason=Foo|date=YYYY-MM-DD}}

These templates need a "must-subst" property of sorts in template data first (bug 65550), but that would make this easier already.

The subst-behaviour is a super set of the scope of this bug (autofill values), however it may be enough.

The problem with a declarative autofill (as opposed to substituting a wrapper template) is that you'd need a fair amount of logic to express what you want to be filled in. Obviously you don't just want a literal string to be inserted, because then you'd just have users omit it and use that value as the default value.

With autofill you most probably want a dynamic value (e.g. the result of invoking a template, or magic words like current date/times, current revision user, base page name etc. Some of these (like date) could be trivially done, but that still leaves a lot of questions (how to specify the date etc.) and compatibility.

So I'd say let's solve bug 65550 first and see how that unfolds. If we still feel a need for this we can revisit it later.

This should additionally be helpful since subst-ing is that wikis do now without VisualEditor so they likely have that in place already and will want to keep that for wikitext users.
Comment 6 Gerrit Notification Bot 2014-09-05 17:47:38 UTC
Change 157820 had a related patch set uploaded by Jforrester:
Implement new 'autovalue' parameter property

https://gerrit.wikimedia.org/r/157820
Comment 7 Gerrit Notification Bot 2014-09-19 23:37:42 UTC
Change 157820 merged by jenkins-bot:
Implement new 'autovalue' parameter property

https://gerrit.wikimedia.org/r/157820

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


Navigation
Links