Template:Protection padlock/doc: Difference between revisions
Create template documentation |
m Fix broken example |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{Documentation subpage}}<!-- Please place category links where indicated at the bottom of this page. Thank you! --> | {{Documentation subpage}}<!-- Please place category links where indicated at the bottom of this page. Thank you! --> | ||
{{High-use}} | {{High-use}} | ||
{{Template shortcut|Pp}} | {{Template shortcut|Pp|Pp-protected|Pp-semi-protected}} | ||
This is a general template for producing '''p'''rotection banners and '''p'''adlock icons. It can be used for any protection reason, with any protection action and at any protection level. | This is a general template for producing '''p'''rotection banners and '''p'''adlock icons. It can be used for any protection reason, with any protection action and at any protection level. | ||
{{Lua|Module:Protection banner}} | {{Lua|Module:Protection banner}} | ||
| Line 7: | Line 7: | ||
== Usage == | == Usage == | ||
<pre style="background-color: #f8f9fa; border: medium ridge #ccc; margin-left: 2.5rem; overflow: auto; padding: 0.5em 1em; width: fit-content;"><nowiki>{{ | <pre style="background-color: #f8f9fa; border: medium ridge #ccc; margin-left: 2.5rem; overflow: auto; padding: 0.5em 1em; width: fit-content;"><nowiki>{{Protection padlock | ||
| 1 = <!-- reason for protection --> | | 1 = <!-- reason for protection --> | ||
| small = <!-- yes, for a smaller, right-aligned notice --> | | small = <!-- yes, for a smaller, right-aligned notice --> | ||
| Line 20: | Line 20: | ||
All parameters are optional: | All parameters are optional: | ||
* {{Para|1}}/{{Para|reason}} – The reason that the page was protected. If set, this must be one of the values listed in the [[#Reasons|reasons table]]. | * {{Para|1}}/{{Para|reason}} – The reason that the page was protected. If set, this must be one of the values listed in the [[#Reasons|reasons table]]. | ||
* {{Para|small}} – If set to {{ | * {{Para|small}} – If set to {{Param value|yes}}, {{Param value|y}}, {{Param value|1}}, or {{Param value|true}}, a padlock icon is generated instead of a full protection banner. | ||
* {{Para|action}} – The protection action, must be one of {{ | * {{Para|action}} – The protection action, must be one of {{Param value|edit}} (for normal protection), {{Param value|move}} (for move-protection) or {{Param value|autoreview}} (for pending changes); the default value is {{Param value|edit}}. | ||
* {{Para|date}} – The protection date. This must be valid input to the second parameter of the [[mediawikiwiki:Help:Extension:ParserFunctions##time|#time parser function]]. This argument only has an effect for the {{ | * {{Para|date}} – The protection date. This must be valid input to the second parameter of the [[mediawikiwiki:Help:Extension:ParserFunctions##time|#time parser function]]. This argument only has an effect for the {{Param value|office}} and {{Param value|reset}} reasons. | ||
* {{Para|user}} – The username of the user to generate links for. As of July 2014, this only has an effect when the {{ | * {{Para|user}} – The username of the user to generate links for. As of July 2014, this only has an effect when the {{Param value|usertalk}} reason is specified. | ||
* {{Para|section}} – The section name of the protected page's talk page where discussion is taking place. This works for most, but not all, values of {{Para|reason}}. | * {{Para|section}} – The section name of the protected page's talk page where discussion is taking place. This works for most, but not all, values of {{Para|reason}}. | ||
* {{Para|category}} – Categories are suppressed if this is set to {{ | * {{Para|category}} – Categories are suppressed if this is set to {{Param value|no}}, {{Param value|n}}, {{Param value|0}} or {{Param value|false}}. | ||
=== Reasons === | === Reasons === | ||
| Line 34: | Line 34: | ||
=== Syntax examples === | === Syntax examples === | ||
==== Padlock icons ==== | ==== Padlock icons ==== | ||
* Padlock icon for a page protected due to vandalism: | * Padlock icon for a page protected due to vandalism: ⇒ {{Template link general|code=on|Protection padlock|vandalism|3=small=yes}} | ||
* Padlock icon for a page temporarily protected due to editing disputes: | |||
* Padlock icon for a page temporarily protected due to editing disputes: ⇒ {{Template link general|code=on|Protection padlock|dispute|3=small=yes}} | |||
==== Banners ==== | ==== Banners ==== | ||
* Banner for a page protected due to sockpuppetry, with a link to a talk page discussion: | * Banner for a page protected due to sockpuppetry, with a link to a talk page discussion: ⇒ {{Template link general|code=on|Protection padlock|sock|3=section=Sockpuppetry concerns}} | ||
* Banner for a page temporarily move-protected due to page move vandalism: | |||
* Banner for a page temporarily move-protected due to page move vandalism: ⇒ {{Template link general|code=on|Protection padlock|vandalism|3=action=move}} | |||
== Visibility == | == Visibility == | ||
| Line 47: | Line 49: | ||
{{TemplateData header}} | {{TemplateData header}} | ||
<templatedata>{ | <templatedata>{ | ||
"description": "Produces banners to describe why a page is protected | "description": "Produces banners and padlock icons to indicate and/or describe why a page is protected", | ||
"format": "inline", | |||
"paramOrder": [ | "paramOrder": [ | ||
" | "reason", | ||
"small", | "small", | ||
"action", | "action", | ||
| Line 58: | Line 61: | ||
], | ], | ||
"params": { | "params": { | ||
"small": { | "small": { | ||
"description": " | "description": "When set to a Boolean truthy value (one of 'yes', 'y', '1' 'on' or 'true') a padlock top icon is displayed on the page instead of a full protection banner", | ||
"example": " | "example": "yes", | ||
"type": "boolean", | "type": "boolean", | ||
"label": "Smaller notice" | |||
"label": " | |||
}, | }, | ||
"action": { | "action": { | ||
"description": " | "description": "The user behaviors which are restricted, must be one of: 'edit' (for normal protection), 'move' (for move-protection) or 'autoreview' (for pending changes)", | ||
"example": "move", | "example": "move", | ||
"type": " | "type": "line", | ||
"default": "edit", | "default": "edit", | ||
"label": "Restricted action", | "label": "Restricted action(s)", | ||
"suggestedvalues": [ | "suggestedvalues": [ | ||
"edit", | "edit", | ||
| Line 99: | Line 81: | ||
}, | }, | ||
"date": { | "date": { | ||
"description": " | "description": "The date protection was instituted, formatted according to ISO 8601; only has an effect for the 'reset' reason.", | ||
"type": "date", | "type": "date", | ||
"label": "Date protected", | "label": "Date protected", | ||
"example": " | "example": "YYYY-MM-DD" | ||
}, | }, | ||
"user": { | "user": { | ||
"description": "Username of the | "description": "Username of the person responding to edit requests; this only has an effect when the 'usertalk' reason is specified.", | ||
"type": "wiki-user-name", | "type": "wiki-user-name", | ||
"label": " | "label": "Protection overseer username", | ||
"example": "JoeSchmoe" | |||
}, | }, | ||
"section": { | "section": { | ||
"description": " | "description": "Name of the section of the protected page's Talk page where discussion is taking place; this works for most, but not all, values of reason.", | ||
"type": " | "type": "line", | ||
"label": " | "label": "Talk page section", | ||
"example": "Protection underway" | |||
}, | }, | ||
"category": { | "category": { | ||
"description": " | "description": "Automatic categorization is suppressed if this is set to 'no', 'n', '0', 'off' or 'false'", | ||
"type": "boolean", | "type": "boolean", | ||
"label": " | "label": "Auto-categorization", | ||
"example": " | "example": "no" | ||
" | }, | ||
"reason": { | |||
"aliases": [ | |||
"1" | |||
], | |||
"label": "Protection reason", | |||
"description": "Explicit justification for protection, may be one of: 'dispute', 'dmca', 'mainpage', 'reset', 'sock', 'template', 'usertalk' or 'vandalism'.", | |||
"example": "vandalism", | |||
"type": "line", | |||
"suggestedvalues": [ | |||
"vandalism", | |||
"template", | |||
"usertalk", | |||
"dispute", | |||
"dmca", | |||
"mainpage", | |||
"reset", | |||
"sock" | |||
], | |||
"suggested": true | |||
} | } | ||
} | } | ||
Latest revision as of 01:58, 1 January 2026
| This is a documentation subpage for Template:Protection padlock. It may contain usage information, categories and other content that is not part of the original template page. |
| This template is used on many pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
This is a general template for producing protection banners and padlock icons. It can be used for any protection reason, with any protection action and at any protection level.
| This template uses Lua: |
Usage
{{Protection padlock
| 1 = <!-- reason for protection -->
| small = <!-- yes, for a smaller, right-aligned notice -->
| action = <!-- the actions restricted by the protection -->
| date = <!-- Date when protection was instituted -->
| user = <!-- Username of contact point for edit requests -->
| section = <!-- Name of section on that user's Usertalk page for those requests -->
| category = <!-- Suppress automatic category inclusion when this is set to 'no' -->
}}
Parameters
All parameters are optional:
|1=/|reason=– The reason that the page was protected. If set, this must be one of the values listed in the reasons table.|small=– If set toyes,y,1, ortrue, a padlock icon is generated instead of a full protection banner.|action=– The protection action, must be one ofedit(for normal protection),move(for move-protection) orautoreview(for pending changes); the default value isedit.|date=– The protection date. This must be valid input to the second parameter of the #time parser function. This argument only has an effect for theofficeandresetreasons.|user=– The username of the user to generate links for. As of July 2014, this only has an effect when theusertalkreason is specified.|section=– The section name of the protected page's talk page where discussion is taking place. This works for most, but not all, values of|reason=.|category=– Categories are suppressed if this is set tono,n,0orfalse.
Reasons
The following table contains the available reasons, plus the actions for which they are available. Reasons are used to customize the banner text, to place articles in more specific hidden categories such as Category:Zoophilia Wiki pages semi-protected against vandalism, and sometimes to change the icon of the banner (e.g. office actions).
| Reason | Action | Description |
|---|---|---|
| blp | edit | For pages protected to promote compliance with the biographies of living persons policy |
| dispute | edit | For pages protected due to editing disputes |
| dmca | edit | For pages protected due to Digital Millennium Copyright Act takedown requests |
| mainpage | edit | For pages protected for being displayed on the Main Page |
| sock | edit | For pages protected due to sock puppetry |
| template | edit | For high-risk templates and Lua modules |
| usertalk | edit | For pages protected against disruptive edits by a particular user or users |
| vandalism | edit | For pages protected against vandalism |
| dispute | move | For pages protected against page moves due to disputes over the page title |
| vandalism | move | For pages protected against page move vandalism |
Syntax examples
Padlock icons
- Padlock icon for a page protected due to vandalism: ⇒
{{Protection padlock|vandalism|small=yes}}
- Padlock icon for a page temporarily protected due to editing disputes: ⇒
{{Protection padlock|dispute|small=yes}}
Banners
- Banner for a page protected due to sockpuppetry, with a link to a talk page discussion: ⇒
{{Protection padlock|sock|section=Sockpuppetry concerns}}
- Banner for a page temporarily move-protected due to page move vandalism: ⇒
{{Protection padlock|vandalism|action=move}}
Visibility
This template will hide itself (not display a padlock icon) if it is used on a page that is not currently protected.
TemplateData
TemplateData for Protection padlock
Produces banners and padlock icons to indicate and/or describe why a page is protected
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Protection reason | reason 1 | Explicit justification for protection, may be one of: 'dispute', 'dmca', 'mainpage', 'reset', 'sock', 'template', 'usertalk' or 'vandalism'.
| Line | suggested |
| Smaller notice | small | When set to a Boolean truthy value (one of 'yes', 'y', '1' 'on' or 'true') a padlock top icon is displayed on the page instead of a full protection banner
| Boolean | optional |
| Restricted action(s) | action | The user behaviors which are restricted, must be one of: 'edit' (for normal protection), 'move' (for move-protection) or 'autoreview' (for pending changes)
| Line | suggested |
| Date protected | date | The date protection was instituted, formatted according to ISO 8601; only has an effect for the 'reset' reason.
| Date | optional |
| Protection overseer username | user | Username of the person responding to edit requests; this only has an effect when the 'usertalk' reason is specified.
| User | optional |
| Talk page section | section | Name of the section of the protected page's Talk page where discussion is taking place; this works for most, but not all, values of reason.
| Line | optional |
| Auto-categorization | category | Automatic categorization is suppressed if this is set to 'no', 'n', '0', 'off' or 'false'
| Boolean | optional |
See also