Module:Template wrapper/doc
![]() | This is a documentation subpage for Module:Template wrapper. It may contain usage information, categories and other content that is not part of the original module page. |
This module is to be used in cs1|2 wrapper templates to allow those templates to provide 'default' settings and at the same time allow editors to pass additional parameters to the underlying cs1|2 template.
This module requires one parameter: |template=
, the name (without namespace) of the template that is wrapped. {{cite Grove}}
wraps {{cite encyclopedia}}
so requires |template=cite encyclopedia
.
When writing a wrapper template, give this module all of the normally required default parameters necessary to write the citation in its base form. Editors then use the wrapper template as is or may supply additional cs1|2 parameters. Any of the normal cs1|2 parameters supported by the wrapped template may be added to the wrapper template or supplied by editors in article space. When an editor supplies a parameter that has a default value in the wrapper template, the editor-supplied value overrides the default.
Certain cs1|2 parameters require the presence of other parameters. For example, |url-access=subscription
requires |url=
. When a wrapper template does not specify |url=
as a default but appropriate urls, when provided, are subscription-only, the wrapper template should test for the presence of a url and set |url-access=
accordingly:
|url-access={{#if:{{{url|}}}|subscription}}