Module:Protection banner/config/doc

From Chalo Chatu, Zambia online encyclopedia
Revision as of 07:42, 29 September 2025 by Chalochatu (talk | contribs) (Protected "Module:Protection banner/config/doc" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

This is the documentation page for Module:Protection banner/config

This page documents the configuration file for Module:Protection banner on Chalo Chatu. It defines the site-wide defaults for icons, wording, and categories used in protection notices.

Purpose

  • Holds configuration tables used by Module:Protection banner.
  • Central place to localise category names and icon filenames.
  • Makes it easy to update protection styles without editing the main module.

Contents

The module returns one table with the following keys:

images
Maps actions and levels to file names for padlock icons. Example:
images = {
  edit = {
    sysop = 'Padlock-red.svg',
    templateeditor = 'Padlock-orange.svg',
    extendedconfirmed = 'Padlock-amber.svg',
    autoconfirmed = 'Padlock-yellow.svg',
    ['*'] = 'Padlock-grey.svg',
    default = 'Padlock-blue.svg'
  },
  move = { default = 'Padlock-blue.svg' },
  upload = { default = 'Padlock-blue.svg' },
  default = 'Padlock-blue.svg'
}
padlockIndicatorName
Internal name used for small padlock indicators. Default is pp.
protectionLevels
Wording used in banners to describe levels. Example:
protectionLevels = {
  edit = {
    sysop='fully protected',
    templateeditor='template-protected',
    extendedconfirmed='extended confirmed protected',
    autoconfirmed='semi-protected',
    ['*']='unprotected',
    default='protected'
  },
  move = { default='move-protected' },
  upload = { default='upload-protected' }
}
categories
Maps action/level combinations to categories. Example:
categories = {
  ['edit/sysop']            = 'Fully protected pages',
  ['edit/templateeditor']   = 'Template-protected pages',
  ['edit/extendedconfirmed']= 'Extended-confirmed protected pages',
  ['edit/autoconfirmed']    = 'Semi-protected pages',
  ['move/sysop']            = 'Move-protected pages',
  ['upload/sysop']          = 'Upload-protected pages',
  default                   = 'Protected pages'
}
talkNsName
The localized name for the Talk namespace (used in some blurbs). Default: Talk.

How to edit

  • Change icon file names to match files available on Chalo Chatu.
  • Change category names to match your category scheme.
  • Add translations/local terms if needed.
  • Do not remove required keys; instead, adjust their values.

Examples

With this config, calling:

{{pp-meta|vandalism|action=edit|level=autoconfirmed|expiry=indef}}

will:

  • Display the yellow padlock (Padlock-yellow.svg).
  • Show the phrase: "This page is semi-protected for vandalism. Protection is indefinite."
  • Add the page to Category:Semi-protected pages.

See also