Template:Deprecated template: Difference between revisions

From Xenharmonic Wiki
Jump to navigation Jump to search
Adopt template: Mbox
Overthink (talk | contribs)
Fix the code: {{ARTICLESPACE}} uses the namespace of the *page it's transcluded on*, not the namespace of the template itself, so it would be problematic.
 
(16 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<includeonly>{{Mbox|
<includeonly>{{Mbox
| icon = Icon-Deprecated.png
| type = delete
| type = delete
| text = [[Template: {{{1}}}]] is deprecated. {{#if:{{{2|}}}|Please use [[{{{2}}}]] instead.}} {{{details|}}}
| text = [[{{{1|{{ROOTPAGENAME}}}}}]] is deprecated. {{#if:{{{2|}}}|Please use [[{{{2}}}]] instead.}}
}}
{{#ifeq:Template:{{ucfirst:{{{1|}}}}}|{{FULLPAGENAME}}|[[Category:Deprecated templates]]|[[Category:Pages using deprecated templates]]}}</includeonly>
<noinclude>The <nowiki>{{</nowiki>'''Deprecated template'''<nowiki>}}</nowiki> template notifies users that a given template has been replaced by a different one or ones, or simply deprecated (advised to no longer be used) without a replacement. Whenever possible, it should replace the deprecated template's content entirely, so that someone using the template will see only the message.
 
== Usage ==
Use as follows:
 
<nowiki>{{Deprecated template|Old template|Template: New template|details=Further details.}}</nowiki>
 
as to get:


{{Mbox|
{{#if: {{{details|}}} | '''Details:''' {{{details}}}}}
| type = delete
| text = '''Template: Old template''' is deprecated. Please use [[Template: New template]] instead. Further details.
}}
}}
{{Category handler
| {{#ifeq: {{NAMESPACE}} | Template
    | {{#ifeq: {{lc:{{ARTICLEROOTPAGENAME}}}} | template:deprecated template
        | <!-- Don't categorize self -->
        | Deprecated templates
      }}
    | Pages with deprecated templates
  }}
| {{{debug|}}}
}}</includeonly><noinclude>
{{documentation}}


The last two parameters are optional. This can be useful when the template was replaced by something other than a new template, like a category.
[[Category:Message boxes]]
 
</noinclude>
The parameter names can be omitted if they are used in the same order as specified above.
 
== See also ==
* [[:Category:Deprecated templates]]
* [[:Category:Pages with deprecated templates]]
 
[[Category:Message boxes]]</noinclude>

Latest revision as of 04:19, 2 May 2026

Template documentation[view] [edit] [history] [purge]
This template should not be substituted.
English Wikipedia has an article on:
Not to be confused with Template:Deprecated.

Template:Deprecated template notifies users that a template has been replaced by one or more new templates, or deprecated (advised to no longer be used) without a replacement. This template should not be placed in a page's documentation page; instead, it is placed within a template's code, either as part of it or replacing it entirely, to notify editors about that template's status. Pages that include this template are placed under Category:Pages with deprecated templates.

Usage

Use as follows:

{{Deprecated template|Template: Old template|Template: New template|details=Further details.}}

to get:

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

Details: Further details.


Note: The <includeonly> and </includeonly> tags are needed for the template to work properly on both the template page and pages where the deprecated template is transcluded.

The last two parameters are optional. This can be useful when the template was replaced by something other than a new template, like a category.

The parameter names can be omitted if they are used in the same order as specified above.

See also