<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.limswiki.org/index.php?action=history&amp;feed=atom&amp;title=Module%3AProtection_banner%2Fdoc</id>
	<title>Module:Protection banner/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.limswiki.org/index.php?action=history&amp;feed=atom&amp;title=Module%3AProtection_banner%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://www.limswiki.org/index.php?title=Module:Protection_banner/doc&amp;action=history"/>
	<updated>2026-04-04T17:59:26Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.36.1</generator>
	<entry>
		<id>https://www.limswiki.org/index.php?title=Module:Protection_banner/doc&amp;diff=16576&amp;oldid=prev</id>
		<title>Shawndouglas: Created as needed.</title>
		<link rel="alternate" type="text/html" href="https://www.limswiki.org/index.php?title=Module:Protection_banner/doc&amp;diff=16576&amp;oldid=prev"/>
		<updated>2014-11-22T17:07:09Z</updated>

		<summary type="html">&lt;p&gt;Created as needed.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This module creates protection banners and padlock icons that are placed at the top of [[Help:Protection|protected pages]].&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
Most users will not need to use this module directly. For adding protection templates to pages you can use the {{tl|pp}} template, or you may find it more convenient to use one of the more specific protection templates in the table below.&lt;br /&gt;
&lt;br /&gt;
{{protection templates}}&lt;br /&gt;
&lt;br /&gt;
=== From wikitext ===&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;#123;{#invoke:Protection banner|main&lt;br /&gt;
 | 1        = ''reason''&lt;br /&gt;
 | small    = ''yes/no''&lt;br /&gt;
 | action   = ''action''&lt;br /&gt;
 | expiry   = ''expiry''&lt;br /&gt;
 | date     = ''protection date''&lt;br /&gt;
 | user     = ''username''&lt;br /&gt;
 | section  = ''talk page section name''&lt;br /&gt;
 | category = ''no''&lt;br /&gt;
 }&amp;amp;#125;&lt;br /&gt;
&lt;br /&gt;
The #invoke syntax can be used for creating protection templates more specific than {{tl|pp}}. For example, it is possible to create a protection template which always shows a padlock icon by using the code &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:Protection banner|main|small=yes}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. Pages which call this template will still be able to use other arguments, like ''action'' and ''expiry''. However, this only works one level deep; a page calling a template which calls another template containing the above code will not automatically be able to use parameters like ''action'' and ''expiry''.&lt;br /&gt;
&lt;br /&gt;
=== From Lua ===&lt;br /&gt;
&lt;br /&gt;
First, load the module.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local mProtectionBanner = require('Module:ProtectionBanner')&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then you can make protection banners by using the _main function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
mProtectionBanner._main(args, cfg, titleObj)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;var&amp;gt;args&amp;lt;/var&amp;gt; is an table of arguments to pass to the module. For possible keys and values for this table, see the [[#Parameters|parameters section]]. The &amp;lt;var&amp;gt;cfg&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;titleObj&amp;lt;/var&amp;gt; variables are intended only for testing; &amp;lt;var&amp;gt;cfg&amp;lt;/var&amp;gt; specifies a customised config table to use instead of [[Module:Protection banner/config]], and &amp;lt;var&amp;gt;titleObj&amp;lt;/var&amp;gt; specifies a mw.title object to use instead of the current title. &amp;lt;var&amp;gt;args&amp;lt;/var&amp;gt;, &amp;lt;var&amp;gt;cfg&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;titleObj&amp;lt;/var&amp;gt; are all optional.&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
All parameters are optional.&lt;br /&gt;
&lt;br /&gt;
* '''1''' - the reason that the page was protected. If set, this must be one of the values listed in the [[#Reasons|reasons table]].&lt;br /&gt;
* '''small''' - if set to &amp;quot;yes&amp;quot;, &amp;quot;y&amp;quot;, &amp;quot;1&amp;quot;, or &amp;quot;true&amp;quot;, a padlock icon is generated instead of a full protection banner.&lt;br /&gt;
* '''action''' - the protection action. Must be one of &amp;quot;edit&amp;quot; (for normal protection), &amp;quot;move&amp;quot; (for move-protection) or &amp;quot;autoreview&amp;quot; (for pending changes). The default value is &amp;quot;edit&amp;quot;.&lt;br /&gt;
* '''expiry''' - the expiry date of the protection. This can be a date (for temporary protection), or one of the strings &amp;quot;indef&amp;quot;, &amp;quot;indefinite&amp;quot;, &amp;quot;indefinitely&amp;quot;, or &amp;quot;infinite&amp;quot; (for indefinite protection). If this is a date, it must be valid input to the second parameter of the [[mw:Help:Extension:ParserFunctions##time|#time parser function]].&lt;br /&gt;
* '''date''' - the protection date. This must be valid input to the second parameter of the [[mw:Help:Extension:ParserFunctions##time|#time parser function]]. This argument has an effect for reasons that use the PROTECTIONDATE parameter in their configuration. As of July 2014, those were the &amp;quot;office&amp;quot; and &amp;quot;reset&amp;quot; reasons.&lt;br /&gt;
* '''user''' - the username of the user to generate links for. As of July 2014, this only has an effect when the &amp;quot;usertalk&amp;quot; reason is specified.&lt;br /&gt;
* '''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''.&lt;br /&gt;
* '''category''' - categories are suppressed if this is set to &amp;quot;no&amp;quot;, &amp;quot;n&amp;quot;, &amp;quot;0&amp;quot;, or &amp;quot;false&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Reasons ==&lt;br /&gt;
&lt;br /&gt;
The following table contains the available reasons, plus the actions for which they are available.&lt;br /&gt;
&lt;br /&gt;
{{#invoke:Protection banner/documentation|reasonTable}}&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
&lt;br /&gt;
Below is a list of some of the common errors that this module can produce, and how to fix them.&lt;br /&gt;
&lt;br /&gt;
=== Invalid expiry ===&lt;br /&gt;
&lt;br /&gt;
{{error|Error: invalid expiry (&amp;quot;abc&amp;quot;)}}&lt;br /&gt;
&lt;br /&gt;
This error is produced if you supply an {{para|expiry}} parameter value that is not recognised as a valid date by the #time parser function. If in doubt, you can just use a date in the format &amp;quot;dd Month YYYY&amp;quot;, e.g. &amp;quot;{{#time:j F Y|+ 1 week}}&amp;quot;. To see a full range of valid inputs, see the [[mw:Help:Extension:ParserFunctions##time|#time documentation]] (only the first parameter, the ''format string'', may be specified).&lt;br /&gt;
&lt;br /&gt;
=== Invalid protection date ===&lt;br /&gt;
&lt;br /&gt;
{{error|Error: invalid protection date (&amp;quot;abc&amp;quot;)}}&lt;br /&gt;
&lt;br /&gt;
This error is produced if you supply an {{para|date}} parameter value that is not recognised as a valid date by the #time parser function. If in doubt, you can just use a date in the format &amp;quot;dd Month YYYY&amp;quot;, e.g. &amp;quot;{{#time:j F Y|+ 1 week}}&amp;quot;. To see a full range of valid inputs, see the [[mw:Help:Extension:ParserFunctions##time|#time documentation]] (only the first parameter, the ''format string'', may be specified).&lt;br /&gt;
&lt;br /&gt;
=== Invalid action ===&lt;br /&gt;
&lt;br /&gt;
{{error|Error: invalid action (&amp;quot;abc&amp;quot;)}}&lt;br /&gt;
&lt;br /&gt;
This error is produced if you specify an invalid protection action. There are only three valid actions: &amp;lt;code&amp;gt;edit&amp;lt;/code&amp;gt; (the default, for normal protection), &amp;lt;code&amp;gt;move&amp;lt;/code&amp;gt; (for move-protection), and &amp;lt;code&amp;gt;autoreview&amp;lt;/code&amp;gt; (for [[WP:PC|pending changes]]). This should only be possible if you are using a template that supports manually specifying the protection action, such as {{tl|pp}}, or if you are using #invoke directly. If this is not the case, please leave a message on [[Module talk:Protection banner]].&lt;br /&gt;
&lt;br /&gt;
=== Reasons cannot contain the pipe character ===&lt;br /&gt;
&lt;br /&gt;
{{error|Error: reasons cannot contain the pipe character (&amp;quot;&amp;amp;#124;&amp;quot;)}}&lt;br /&gt;
&lt;br /&gt;
This error is produced if you specify a reason using the {{para|1}} parameter that includes a pipe character (&amp;quot;&amp;amp;#124;&amp;quot;). Please check that you are not entering the {{tl|!}} template into this parameter by mistake. The pipe character is disallowed as the module uses it internally. A list of valid reasons can be seen in the [[#Reasons|reasons section]].&lt;br /&gt;
&lt;br /&gt;
=== Other errors ===&lt;br /&gt;
&lt;br /&gt;
If you see an error other than the ones above, it is likely to either be a bug in the module or mistake in the configuration. Please post a message about it at [[Module talk:Protection banner]].&lt;br /&gt;
&lt;br /&gt;
== Technical details ==&lt;br /&gt;
&lt;br /&gt;
This module uses configuration data from [[Module:Protection banner/config]]. Most of the module's behaviour can be configured there, making it easily portable across different wikis and different languages.&lt;br /&gt;
&lt;br /&gt;
General test cases for the module can be found at [[w:en:Module:Protection banner/testcases|Module:Protection banner/testcases]], and test cases specific to enwiki's config can be found at [[w:en:Module:Protection banner/config/testcases|Module:Protection banner/config/testcases]].&lt;br /&gt;
&lt;br /&gt;
Bug reports and feature requests should be made on [[w:en:Module talk:Protection banner|the module's talk page]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{#ifeq:{{SUBPAGENAME}}|sandbox||&lt;br /&gt;
&amp;lt;!-- Categories go here and interwikis go in Wikidata. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>Shawndouglas</name></author>
	</entry>
</feed>