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

       Web browser: ---
             Bug #: 30648
           Summary: Automatic pass-through of existing named parameters to
                    nested templates
           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


Related to bug 15704 and to piped passed parameters.
Also related to templates using meta-templates.

Imagine a template {{main}} with a parameter {{{article}}} that may optionally
be defined by user. If not, it should be defaulted to {{PAGENAME}}.
Say template {{main}} repeatedly calls for template {{core}} a number of times.
And say template {{core}} needs to receive the value of 'article', among other
parameters.

Template {{{core}}} could easily process {{PAGENAME}} (or any other defaulted
value) by its own. What it really needs is to know if {{{article}}} is actually
defined or not.

We currently manage two ways to work around this situation:
1. By means of *repeatedly* passing |article={{{article|{{PAGENAME}}}}} from
main to core, with core using {{{article}}} as is.
2. Passing |article={{{article|}}} with core *repeatedly* asking
{{#if:{{{article|}}}|{{{article}}}|{{PAGENAME}} }}


Well I suggest that, at parsing time, all defined named parameters (except
number-named ones) in main template call (ie parameters existing in wikitext
tag) be passed "as they are" to all nested templates. Of course, any re-defined
parameter by main template code should override this pass-through condition.
Number-named parameters should be kept apart of this treatment.

This enhancement will permit to obviate unnecessary re-definitions at 'main
template' side and conditional #ifs at 'core' side. While parameters not
expected by sub-called 'core' or 'meta' templates will be ignored.
As non-defined parameters will not be passed, and main template will not
re-transmit them by code, then core template will not see them at all.

Backward compatibility is almost complete, except for rare occurrences of
equally-named parameters which may cause malfunctions. But these cases may
easily be addressed.

-- 
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