Extension:ArticleToCategory2

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manualManual:Extensions
Crystal Clear action run.png
Article To Category 2

Release status:Extension status stable

px
ImplementationTemplate:Extension#type Page action
DescriptionTemplate:Extension#description Adds an inputbox to each category page. The content of new page will contain "[[category:]]" automatically. See doc. for optional features.
Author(s)Template:Extension#username (MikaelLindmarktalk)
Latest versionTemplate:Extension#version 1.1 (2017-08-12)
MediaWikiTemplate:Extension#mediawiki 1.27+
Database changesTemplate:Extension#needs-updatephp No
LicenseTemplate:Extension#license GNU General Public License 3.0 or later
Download
ParametersTemplate:Extension#parameters
  • $wgarticletocategory2ConfigBlacklist
Hooks usedTemplate:Extension#hook
CategoryPageViewManual:Hooks/CategoryPageView
EditFormPreloadTextManual:Hooks/EditFormPreloadText

Translate the ArticleToCategory2 extension if it is available at translatewiki.net

Check usage and version matrix.

The Article To Category 2 extension is based on the Add Article to Category extension by BiGreat (Liang Chen). It adds an inputbox to each category page. The content of new page will contain "[[Category:]]" automatically.[1] See section Configuration parameters for optional behavior. Suggested changes and additions (exclude categories, i18n localisation, adding category, etc) by Julien Devincre and Cynthia Mattingly on the Extension talk:Add Article to Category is included.

Installation instructions[edit]

Installation[edit]

  • Download and place the file(s) in a directory called ArticleToCategory2 in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    require_once "$IP/extensions/ArticleToCategory2/ArticleToCategory2.php";
    
  • YesY Done - Navigate to Special:Version on your wiki to verify that the extension is successfully installed.


Example[edit]

require_once("$IP/extensions/ArticleToCategory2/ArticleToCategory2.php");
$wgarticletocategory2ConfigBlacklist=false;
$wgGroupPermissions['*']['ArticleToCategory2'] = true;
$wgGroupPermissions['*']['ArticleToCategory2AddCat'] = false;

Configuration parameters[edit]

$wgGroupPermissions['*']['ArticleToCategory2AddCat'][edit]

Set this flag to true and a second input box will be added, where the users may add categories into categories.

$wgarticletocategory2ConfigBlacklist[edit]

Set this flag to true to enable the category blacklist in "MediaWiki:Add Article to Category 2 excluded categories" page (you need to create this page first). Usage (example):

== Excluded Categories from Add To Article 2 Extension ==

;My Excluded category 1
;My Excluded category 2

;Another one

If you don't like the name of this page, you can replace it by changing the following line in the GetExcludedCategories() function :

     $specialcatpage='Add Article to Category 2 excluded categories';


See also[edit]

Notes[edit]

  1. The text (i.e "Category" in English) depends on what language the MediaWiki is using.