Editing
Module:Protection banner/doc
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Usage == 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. {{protection templates}} === From wikitext === {{#invoke:Protection banner|main | 1 = ''reason'' | small = ''yes/no'' | action = ''action'' | date = ''protection date'' | user = ''username'' | section = ''talk page section name'' | category = ''yes'' }} 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 <code><nowiki>{{#invoke:Protection banner|main|small=yes}}</nowiki></code>. Pages which call this template will still be able to use other arguments, like ''action''. 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''. '''''Note:''' You should no longer specify the expiry, as it is automatically retrieved in all cases.'' === From Lua === First, load the module. <syntaxhighlight lang="lua"> local mProtectionBanner = require('Module:Protection banner') </syntaxhighlight> Then you can make protection banners by using the _main function. <syntaxhighlight lang="lua"> mProtectionBanner._main(args, cfg, titleObj) </syntaxhighlight> <var>args</var> is a table of arguments to pass to the module. For possible keys and values for this table, see the [[#Parameters|parameters section]]. The <var>cfg</var> and <var>titleObj</var> variables are intended only for testing; <var>cfg</var> specifies a customised config table to use instead of [[Module:Protection banner/config]], and <var>titleObj</var> specifies a mw.title object to use instead of the current title. <var>args</var>, <var>cfg</var> and <var>titleObj</var> are all optional.
Summary:
Please note that all contributions to Kautepedia are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
Kautepedia:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
British English
Not logged in
Talk
Contributions
Log in
Namespaces
Module
Discussion
British English
Views
Read
Edit source
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information