Module:Check blp parameter/sandbox
Appearance
| This is the module sandbox page for Module:Check blp parameter (diff). |
| This Lua module is used on approximately 2,970,000 pages, or roughly 4% of all pages. To avoid major disruption and server load, any changes should be tested in the module's /sandbox or /testcases subpages, or in your own module sandbox. The tested changes can be added to this page in a single edit. Consider discussing changes on the talk page before implementing them. |
| This module is rated as ready for general use. It has reached a mature state, is considered relatively stable and bug-free, and may be used wherever appropriate. It can be mentioned on help pages and other Wikipedia resources as an option for new users. To minimise server load and avoid disruptive output, improvements should be developed through sandbox testing rather than repeated trial-and-error editing. |
Usage
[edit]This module is used by Template:WikiProject Biography to check for issues with the |blp=, |BLP= and |living= parameters.
require('strict')
local p = {}
p.main = function(frame)
local args = frame:getParent().args
local yesno = require('Module:Yesno')
local current_title = mw.title.getCurrentTitle()
local pagetype = require('Module:Pagetype')._main{page = current_title.prefixedText}
local templates = mw.loadData('Module:WikiProject banner/config').banner_shell.redirects
local getparam = function(pa)
local TPVmodule = require('Module:Template parameter value').getParameter
local success, param = TPVmodule(current_title.fullText, templates, pa, {ignore_subtemplates=true, ignore_blank=true})
return success and param or nil
end
local blp = getparam('blp')
if args.category~='no' and pagetype=='article' and yesno(blp)==nil and blp~='other' and blp~='activepol' then
local warning = require('Module:If preview')._warning
local msg = 'Banner shell requires valid blp parameter! See [[:Category:Biography articles without blp parameter]] for guidance.'
return '[[Category:Biography articles without blp parameter]]' .. warning{[1] = msg}
end
end
return p