Last modified: 2012-01-23 13:42:36 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 T33685, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 31685 - Introduce call: modifier
Introduce call: modifier
Status: NEW
Product: MediaWiki
Classification: Unclassified
Templates (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-14 00:13 UTC by Danny B.
Modified: 2012-01-23 13:42 UTC (History)
1 user (show)

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


Attachments

Description Danny B. 2011-10-14 00:13:20 UTC
Many templates use metatemplates. If you want to pass the template parameter to metatemplate you have to repeat it in metatemplate call, which in case of more parameters and/or long parameter names or their values increases the size and illegibility of the code.

Trivial example:

So currently you have Metatemplate, say for universal interproject link, which would be, let's say with this content:

[[{{{project}}}:{{{title}}}]]

Then you have template Wikipedia, which would (to make it easy) be:

{{Metatemplate|project=w|title={{{title}}}}}

which you would call on page by:

{{Wikipedia|title=FooBar}}


Now, it would be much better to have template Wikipedia written this way:

{{call:Metatemplate|project=w}}


How it should work:

Template called by modifier call: should first check for all inherited parameters all the way up in tree and then it should perform overrides depending on presence of parameters in calls.

So, using the definitions above:

Template {{Wikipedia|title=FooBar}} with content
  {{call:Metatemplate|project=w}}
would output
  [[w:FooBar]]
because of inheritance of "title" parameter.

Template {{Wikipedia|title=FooBar}} with content
  {{call:Metatemplate|project=w|title=LoremIpsum}}
would output
  [[w:LoremIpsum]]
because of closer (re)definition of the "title" parameter value.


There is one issue I am not sure how it would be influenced, and that is substing:

Should there be possible to do subst:call:Template / call:subst:Template?
Should there rather exist complementary modifier substcall:Template?
If it would be problem, could there be any other way, how to solve it, for instance have {{#call:}} parser function, thus {{subst:#call:Template}}}}?

OTOH, I can imagine dozens and dozens of cases where to use call: only, but can't now think about practical usage of subst:call: though, so maybe this issue can even be thrown away.
Comment 1 Siebrand Mazeland 2012-01-23 13:42:36 UTC
Untagging milestone 1.19. This has not been resolved, and trunk is closed to new features for 1.19.

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


Navigation
Links