https://bugzilla.wikimedia.org/show_bug.cgi?id=31685

       Web browser: ---
             Bug #: 31685
           Summary: Introduce call: modifier
           Product: MediaWiki
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: Unprioritized
         Component: Templates
        AssignedTo: [email protected]
        ReportedBy: [email protected]
    Classification: Unclassified


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.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to