Issue:Allow multiple surrogate templates, add/change syntax

From FollowTheScore
Revision as of 21:58, 3 February 2009 by Volts (talk | contribs) (+request)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Description: Request to add different syntax for surrogate templates to enable multiple usage and clearer naming
Extension / Version: DPL   /   1.7.5 or newer
Type / Status: Change Request   /   open

Problem

I would like to be able to pass arguments/parameters from more than one template invocation that is on a page and format the output using a single template. If the parameters of the included templates have the same name, there could be a way to recognize from which template they came or if that's not possible, then the last parameter of the same name should override prior calls. I think this works best by adding a new syntax (I don't like the current syntax to begin with since it forces you to have surrogate templates with extra long and possibly confusing names). My suggestion is as follows:

{{#dpl:category=<category forming a list of articles to reference>
 |passfrom={template1},{template2},{template3},...<!-- these templates' parameters are passed -->
 |passto={templateX}<!-- This template receives the parameters from each template, preferrably
                          such that they can be individually accessed using a form like
                          {{#dplpass:template name.parameter}} or just {{{parameter}}}
                          if that's not possible.
                         The four additional parameters %PAGE%, %TITLE%, %DATE%, and %USER%
                          are passed to this template as with the existing format -->
 |passdefault={templateY}<!-- This parameter is optional, but if used the specified template
                               gets called if any of the template invocations to search for are
                               missing; the specified template could also be templateX, if desired.
                              %PAGE% and %TITLE% are passed as parameters,
                               as with the existing format.
                              An addition parameter %TEMPLATES% is also passed noting which
                               templates were not found on the referring page. -->
}}

This would help when some parameters you want are on a page's infobox template invocation and some parameters are on the navbar template invocation. Also, it could allow you to use the same template for multiple purposes, and not just to receive a surrogate call from a single DPL template.

Reply