User:Ferretwings/Sandbox/DPL/Surrogate templates/dpl

Combining multiple templates into one
The dpl clause: "include = {template-1¦combined-template}, {template-2¦combined-template} | mode=userformat"

For this example: "include = {infobox wrapper¦/dpl}, {item infobox¦/dpl} | mode=userformat" (see User:Ferretwings/Sandbox/DPL/Surrogate templates for the full dpl statement)

In most situations, the info will be displayed as the last template is processed. Any info that is not located in the last template listed will need to be stored into dpl variables.

To test which template is being processed, test for unique fields only found on each template (this can be problematic if the called template contains only optional parameters).

If combining many templates, store all info into dpl variables, and use a unique field found in the last called template to trigger the display.

The following dpl display format combines fields from Item infobox and Infobox wrapper; this particular format is only an example, as such a list wouldn't be very useful. Presence of the or  field will trigger the actual display. 