Page MenuHomePhabricator

Introduce call: modifier
Open, MediumPublic

Description

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.


Version: unspecified
Severity: enhancement

Details

Reference
bz31685

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:57 PM
bzimport set Reference to bz31685.
bzimport added a subscriber: Unknown Object (MLST).
Danny_B created this task.Oct 14 2011, 12:13 AM

Untagging milestone 1.19. This has not been resolved, and trunk is closed to new features for 1.19.