Extension:CategoryBrowser

CategoryBrowser creates a drop down list of categories. The amount of subcategories, pages or files can be filter and modified to make custom filters.

Technical details
CategoryBrowser creates special page which implements AJAX-enabled category filter and browser for MediaWiki. Categories can be filtered with pre-defined conditions selected from drop-down list. Every condition contains comparsion operators, which allow to filter the amount of subcategories, pages or files the category should have, logical operators and brackets. Selected condition can be edited with JavaScript-based interface to make custom filters. Custom used-defined category filter is stored in user's cookie for future use. Categories also can be filtered by first letters in their names, optionally with case-insensitive search (implemented for utf8 tables, also may be too slow for large wikis).

AJAX category tree browser shows subcategories of currently "expanded" category, very similar to Extension:CategoryTree, but also shows pages and files as well. Categories, pages and files are browsed via the pager (with limit count), to reduce the system resource consumption in large lists.

Installation
require_once("$IP/extensions/CategoryBrowser/CategoryBrowser.php");
 * download the latest available version and extract it to your wiki extension directory.
 * add the following line to LocalSettings.php
 * check out Special:Version and Special:CategoryBrowser page to verify the installation
 * if there are any problems, make sure you've installed successfully and MediaWiki version is compatible with the extension. Please report the bugs at the talk page. Also you may try using previous version (if available).

Setup
Currently, an extension has the following available settings to setup:

Place one or more of the following lines below the "require_once" line:

CB_Setup::$categoriesLimit = 10; to set the limit (amount) of categories per page equal to 10.

CB_Setup::$pagesLimit = 10; to set the limit (amount) of pages per page equal to 10.

CB_Setup::$filesMaxRows = 2; to set the files pager to display maximum 2 rows in image gallery.

CB_Setup::$imageGalleryPerRow = 2; to set the files pager displayed image gallery 2 images per row (default value is 4). CB_Setup::$imageGalleryPerRow = 0; to disable usage of image gallery (files pager will be identical to pages pager).

CB_Setup::$allowNestedParents = false; to disable browsing of category parents (reverse browsing) (since v0.3.1).

CB_Setup::$allowNoParentsOnly = false; to disable a checkbox for optional selecting of categories which has no parents only (since v0.3.1).

Usage
Go to Special:CategoryBrowser special page either by typing its URL in browser address line, or by clicking the same link at Special:Version or Special:Specialpages. The special page screen is divided into the following parts:


 * Category filter form, which has three subsections:
 * Top section has drop-down selector which allows to choose category filter condition either from the set of pre-defined ones, or from previously edited condition (stored in cookie). Also this section of form has "Search for category by name" field which allows to filter categories by first letters of the titles. This section is visible by default.
 * When the condition filter was selected, two form sections with condition editor are also displayed. Middle section of the form shows currently selected condition filter divided into separate operators (condition line). Bottom section of the form displays "sample" operators to be modified and copied into the middle section, to create a used-defined condition filter (samples line).
 * Category tree section, which displays categories matching the filter selected. When category has subcategories, click at the [+] sign displayed before it to expand it contents. Click "Pages" and "Files" links to display pages and files belonging to the selected category, respectively.

User-defined condition filter editing
Changing parameters of comparsion / logical operators are performed by directly altering input values in condition line. Another operations are performed by choosing small control buttons below the operator. Move the mouse cursor over the desired operator either in condition (middle) or in samples (bottom) line to display the operator's control buttons.


 * To move current operator left, press [<-] control button in condition line. Operation will be performed only when the result does not produce invalid condition.
 * To move current operator right, press [->] control button in condition line. Operation will be performed only when the result does not produce invalid condition.
 * To delete current operator, press [x] control button in condition line. Operation tries to remain validity of condition line (for example, removing matching brackets; when removing condition operator, remove logical operator just before).
 * To copy a new operator to clipboard, press [+] control button in samples line. The copied operator will be displayed in blue color. To clear the clipboard, press the same button twice.
 * To paste an operator from clipboard before current operator, press [+] control button in condition line. Operation will always be allowed in the first and the last position of the condition line. Otherwise, editor's script will try not to allow to create invalid condition filter.
 * To quickly copy/paste new operator from sample line to last position of condition line, press [>+] control button of the desired operator in samples line.
 * To erase the whole condition ("select all"), press [=] control button of "All" operator in samples line.


 * To apply the newly created filter, press "Apply" button.
 * When the created condition is invalid, the erroneous operator is being shown in red / aquamarine colors. Also, "apply" button is disabled.

Download
To extract tgz archive in Windows, free 7zip program can be used.

Todo
More setup options. Implement different representations / layouts of pages / files view (skins?). Use the parameter of special page. Parser function.

Websites Using

 * List of Categories