• Home
  • Random
  • Nearby
  • Log in
  • Settings
Donate Now If Wikipedia is useful to you, please give today.
  • About Wikipedia
  • Disclaimers
Wikipedia

Template:Deprecated template/sandbox

  • Template
  • Talk
  • Language
  • Watch
  • Edit
< Template:Deprecated template
Template:Deprecated template/sandbox is deprecated. Please use [[Template:{{{2}}}]] instead.
This is the template sandbox page for Template:Deprecated template (diff).
See also the companion subpage for test cases.
Template documentation[view] [edit] [history] [purge]
Shortcuts
  • {{TdeprecatedTemplate:Tdeprecated}}
  • {{TemplateObsoleteTemplate:TemplateObsolete}}
  • {{DeprecatedTemplate:Deprecated}}

The {{Deprecated template}} is a template placed in a given template's code (not in the /doc subpage) to notify its users that a given template has been superseded or replaced by another template when the template is transcluded or viewed, or has simply been deprecated (i.e., advised to no longer be used) without a direct replacement. It is useful when a redirect is ineffective due to usage differences, or when reducing the number of redirects is desired to simplify bot parsing.

If the template is fully deprecated, the deprecated template's content can be fully replaced/overridden when transcluded to another page by the message from {{Deprecated template}} using <includeonly>{{Deprecated template}}</includeonly>, ensuring that anyone using the template will only see the notification, and not invoke the deprecated template.

{{Historical template}} is a related template for use on templates where there is consensus for that template to be deprecated, but where removal of the template would seriously break the functionality of historical project pages.

{{Deleted template}} provides a way to delete templates but still retain them for the purpose of correctly displaying old revisions of pages.

Contents

  • 1 Usage
    • 1.1 Templates not fully deprecated
    • 1.2 Fully deprecated templates
  • 2 Parameters
  • 3 See also
  • 4 TemplateData

Usage

edit

Templates not fully deprecated

edit

If the deprecated template is not yet ready for full deprecation since it is still in use (transcluded) on pages, add <noinclude>...</noinclude> tags around the {{Deprecated template}} template in the source code of the deprecated template. This ensures that the deprecation notice appears only on the template’s documentation page and not on every page where the template is transcluded.

If the template is not yet fully deprecated insert in the template's code:

<noinclude>
{{Deprecated template}} <!-- Replace with {{Deprecated template|old template name|new template name}} and remove <noinclude> tags when fully deprecated. See [[Template:Deprecated template]] for more information. -->
</noinclude>

Fully deprecated templates

edit

Once a template has been fully deprecated and is no longer transcluded on any pages, you can remove the <noinclude>...</noinclude> tags surrounding the {{Deprecated template}} in the deprecated template's source code. This will display the deprecation notice on any pages still using the deprecated template.

Afterward, consider nominating the template for deletion through Wikipedia:Templates for discussion, or replacing it with {{Historical template}} to indicate its deprecated status.

{{Deprecated template|Deprecated template name|New template name}}

Usage without a second (replacement) template name simply produces:

Template:Deprecated template/sandbox is deprecated.

Parameters

edit

Standard

{{Deprecated template|Old|New}}

Template:Old is deprecated. Please use Template:New instead.

Additional

The template can show parameters as follows:

{{Deprecated template|Old|New|parameter}}

{{Deprecated template|Old|New|<nowiki>parameter=foo</nowiki>}}

Template:Old is deprecated. Please use {{New|parameter}} instead.
Template:Old is deprecated. Please use {{New|parameter=foo}} instead.


The template can also show a note:

{{Deprecated template|Old|New|note=Further details can be inserted here, such as why the template is retained, the particulars of the replacement process, or when there are two or more replacements.}}

Template:Old is deprecated. Please use Template:New instead. Further details can be inserted here, such as why the template is retained, the particulars of the replacement process, or when there are two or more replacements.

The |note= parameter can also be given as |reason= or |result=.


Special parameters for templates outside template namespace.

|old= and |new= can be used with the full names including namespace.

{{Deprecated template|old=Template:Old|new=Wikipedia:New}}

Template:Old is deprecated. Please see Wikipedia:New instead.

To link to a category full of templates, use :Category:Name of category here, with a leading colon.

The |new= parameter cannot be used with the third unnamed parameter (the one illustrating a parameter of the third template). For example, this is not valid:
     {{Deprecated template|Old|new=User:SnorkelWeasel/MyTemplate|<nowiki>chickens=yes</nowiki>}}
Such a feature could be added, but it has never been needed yet.

Category suppression

The template can be prevented from categorizing by adding |nocat=true. This is only intended for examples, e.g. in the template's own documentation. In that case, not only the page itself will not be categorized, but transclusions of such pages will also be prevented from categorizing in Category:Pages using deprecated templates. Do not use this parameter to passive-aggressively contest a template's documentation. Take up the matter on the template's talk page or that of a relevant other venue, such as WP:Village pump (technical).

See also

edit
  • {{Historical template}} - for deprecated templates that are kept for historical reasons
  • Category:Deprecated templates – the category where this template lists templates it is used on
  • {{Xtd}} (and related templates) – for indicating deprecated (and good, bad and neutral) examples in guidelines, how-tos and template documentation
  • {{Dc}} – inline deprecated code or text; {{Dc2}} variant has strikethrough (both explicitly use the <del> element, and can be used in articles, e.g. about HTML or other specifications that may have deprecated features)
  • {{Superseded}} – for Wikipedia pages
  • {{Obsolete}} – for media files
  • {{Deleted template}} – for deleting a template without breaking old revisions


TemplateData

edit
This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Deprecated template in articles based on its TemplateData.

TemplateData for Deprecated template

Notifies users that a given template has been superseded or replaced by another template, or has simply been deprecated (i.e., advised to no longer be used) without a direct replacement.

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Deprecated template nameold 1

Name of the template to be replaced

Default
{{PAGENAME}}
Linesuggested
Replacementnew 2

The page name of a template which supersedes the deprecated template. It is unnecessary to use namespace prefix, but it may be used, even for other namespaces. To link to a category full of templates, use :Category:Name of category here, with a leading colon.

Linesuggested
Parameter3

The template can show parameters for the new template, must use <nowiki></nowiki> tags

Example
<nowiki>parameter=foo</nowiki>
Contentsuggested
Notenote reason result

Explanation of why the template is deprecated, documentation on how it should be replaced, or any other helpful information.

Contentsuggested
Deprecated byby

Who/what deprecated the template?

Linesuggested
Kept for historical reasons?historical

Any value will output: "and is preserved only for historical reasons"

Example
yes
Booleanoptional
Suppress categorisationnocat

The template can be prevented from categorizing by adding |nocat=true. This is only intended for examples, e.g. in the template's own documentation. In that case, not only the page itself will not be categorized, but transclusions of such pages will also be prevented from categorizing in Category:Pages using deprecated templates. Do not use this parameter to passive-aggressively contest a template's documentation. Take up the matter on the template's talk page or that of a relevant other venue, such as WP:Village pump (technical).

Example
true
Booleanoptional
The above documentation is transcluded from Template:Deprecated template/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Deprecated_template/sandbox&oldid=911140442"
Last edited on 16 August 2019, at 19:45

Languages

      This page is not available in other languages.

      Wikipedia
      • Wikimedia Foundation
      • Powered by MediaWiki
      • This page was last edited on 16 August 2019, at 19:45 (UTC).
      • Content is available under CC BY-SA 4.0 unless otherwise noted.
      • Privacy policy
      • About Wikipedia
      • Disclaimers
      • Contact Wikipedia
      • Code of Conduct
      • Developers
      • Statistics
      • Cookie statement
      • Terms of Use
      • Desktop