Template:Deprecated template: Difference between revisions

m Fixed first parameter syntax (again)
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.
 
(18 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<includeonly><div style="
<includeonly>{{Mbox
margin:4px 10%;
| icon = Icon-Deprecated.png
border:2px #b32424 solid;
| type = delete
background-color:#f8f9fa;
| text = [[{{{1|{{ROOTPAGENAME}}}}}]] is deprecated. {{#if:{{{2|}}}|Please use [[{{{2}}}]] instead.}}
text-align:center;
padding: 1em;">[[{{{old}}}]] is deprecated. {{#if:{{{new|}}}|Please use [[{{{new}}}]] instead.}} {{{details|}}}</div>
{{#ifeq:Template:{{ucfirst:{{{old|}}}}}|{{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 ==
{{#if: {{{details|}}} | '''Details:''' {{{details}}}}}
Use as follows:
}}
{{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}}


<nowiki>{{</nowiki>Deprecated template|old=Deprecated template|new=New template|details=Further details.}}
[[Category:Message boxes]]
 
</noinclude>
as to get:
 
<div style="
margin:4px 10%;
border:2px #b32424 solid;
background-color:#f8f9fa;
text-align:center;
padding: 1em;">[[Template:Deprecated template]] is deprecated. Please use [[Template:New template]] instead. Further details.</div>
 
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 ==
* [[:Category:Deprecated templates]]
* [[:Category:Pages with deprecated templates]]
 
[[Category:Templates]]</noinclude>