Template:Deprecated: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
No edit summary
(Updated documentation and added support for "reason" parameter)
 
(4 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{mbox
<includeonly>{{mbox
|type=content
| type = content
|image=[[File:Generic_Threat_Condition_Icon.webp]]
| image = [[File:Generic_Threat_Condition_Icon.webp|40px]]
|text=This template is considered deprecated and its use in new pages should be avoided.
| text = This template is considered '''deprecated''' and its use in new pages should be avoided. {{{reason|{{{2|No reason was specified.}}}}}}


{{#if: {{{1|}}} | Alternatives:}} {{{1}|No alternatives were specified when this template was added.}}}}}<includeonly>[[Category:Deprecated templates]]</includeonly><noinclude>[[Category:Templates]][[Category:Template maintenance]][[Category:Message box templates]]
{{#if: {{{alternatives|{{{1|}}}}}} | Alternatives: {{{alternatives|{{{1|}}}}}} | No alternatives were specified when this template was added.}}
}}[[Category:Deprecated templates]]</includeonly><noinclude>{{documentation|content=
Mark a template as deprecated and should no longer be used.
 
See also {{Wikipedia|Template:Deprecated_template}}.
== Usage ==
If the template is still in use, this warning should be added in <code><nowiki><noinclude>...</noinclude</nowiki>></code> tags at the top of the page. This will not affect any pages where the template is used and the use of the template can be gradually phased out.
 
If the template is ''fully deprecated'' and should no longer be used at all, this warning should be added without the <code><nowiki><noinclude>...</noinclude</nowiki>></code> tags so that it appears whenever the template is used.
 
Templates marked using this template are added to [[:Category:Deprecated templates]]. Once all usages of the deprecated template are replaced, the template should be deleted to avoid polluting the template namespace.
 
== Examples ==
{{Template demo
| style = list
| caption 1 = Basic usage
| <nowiki>
{{Deprecated}}
</nowiki>
| caption 2 = Suggest alternatives to use instead
| <nowiki>
{{Deprecated|{{t link|this}} or {{t link|that}} }}
</nowiki>
| caption 3 = Specify a reason for deprecation
| <nowiki>
{{Deprecated|Basic MediaWiki links|Icons of this template harm the readability of the text where it is used.}}
</nowiki>
| caption 4 = Block format
| <nowiki>
{{Deprecated
| reason = Icons of this template harm the readability of the text where it is used.
| alternatives = Basic MediaWiki links
}}
</nowiki>
}}
== Template data ==
<templatedata>
{
"params": {
"1": {
"label": "Alternatives",
            "aliases": ["alternatives"],
"description": "Alternative template(s) to use instead of the deprecated one.",
            "type": "string",
"suggested": true
},
        "2": {
"label": "Reason",
            "aliases": ["reason"],
"description": "The reason the template was deprecated and its use should be avoided.",
            "type": "string",
"suggested": true
}
    },
    "description": "Mark a template as deprecated.",
    "format": "inline"
}
</templatedata>
}}
[[Category:Templates]]
[[Category:Template maintenance]]
[[Category:Message box templates]]
</noinclude>

Latest revision as of 20:30, 20 December 2024

Template documentation

Mark a template as deprecated and should no longer be used.

See also Template:Deprecated_template.

Usage

If the template is still in use, this warning should be added in <noinclude>...</noinclude> tags at the top of the page. This will not affect any pages where the template is used and the use of the template can be gradually phased out.

If the template is fully deprecated and should no longer be used at all, this warning should be added without the <noinclude>...</noinclude> tags so that it appears whenever the template is used.

Templates marked using this template are added to Category:Deprecated templates. Once all usages of the deprecated template are replaced, the template should be deleted to avoid polluting the template namespace.

Examples

Basic usage

Markup
{{Deprecated}}
Renders as

Suggest alternatives to use instead

Markup
{{Deprecated|{{t link|this}} or {{t link|that}} }}
Renders as

Specify a reason for deprecation

Markup
{{Deprecated|Basic MediaWiki links|Icons of this template harm the readability of the text where it is used.}}
Renders as

Block format

Markup
{{Deprecated
| reason = Icons of this template harm the readability of the text where it is used.
| alternatives = Basic MediaWiki links
}}
Renders as

Template data

Mark a template as deprecated.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Alternatives1 alternatives

Alternative template(s) to use instead of the deprecated one.

Stringsuggested
Reason2 reason

The reason the template was deprecated and its use should be avoided.

Stringsuggested