Summary: Make current variables available for transcluded
           Product: MediaWiki
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: Normal
         Component: Page rendering

It would be nice, if there would be a easier way to access the variables the
"parent" template has received.

* Template {{A}} transcludes one out of three templates (let’s call them
{{A/n}}), depending on a parameter it was "called" with.
* Overall, {{A/n}} are all the same, save some minor differences like their
background color or the order of the lines in the infobox they are part of.
* Thus {{A/n}} have to get the same parameters. And especially they have to get
the same parameters as {{A}} was "called" with. Only the one distinguishing
parameter may not be needed.

By now, {{A}} would be something like
There is much needless overhead in the source code, which could be rather good
evaded, if {{A/n}} would be aware of {{A}}’s parameters, making {{A}}’s code:
{{switch:{{{1}}} |a={{A/1}} |b={{A/2}} |c={{A/3}} }}.

There would be three options, how to make {{A/n}} aware of {{A}}’s parameters:
* Always give the own parameters to transcluded templates.
* Add a new parameter accessing prefix for {{A/n}}: {{{..:par0}}}.
* Transclude {{A/n}} differently: {{include:A/1}}.

I would prefer the third option, because it would likely 1) be the easiest to
implement, 2) have least overhead and 3) be the most explicit variant.

Main beneficiaries would be beasts like [[Template:Location map]].

Configure bugmail:
------- 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

Reply via email to