Catisect, also known as Category Intersection, is an extension that allows for the searching of category intersections to find pages that share two or more categories.
Intersection namespace
The Intersection namespace is automatically created when the extension is enabled.
Usage
[[Intersection:<category1>::<category2>::<category3>]]
Example: Intersection:Editing::Guides
Gadget
Category Intersection can also be improved with a gadget that allows the selection of categories directly from any article with two or more categories. To enable this tool, the Gadgets extension needs to be enabled and the following pages need to be edited and created/added to for the gadget to work:
Adding the gadget
Definition of the gadget
Create or edit MediaWiki:Gadgets-definition and add the following text:
* intersection[ResourceLoader]|intersection.js
JavaScript for the gadget
Create MediaWiki:Gadget-intersection.js and add the following code:
$(function() {
var links = $("#catlinks ul a");
if (links.length <= 1) return;
links.before('<input type="checkbox" checked="checked" class="intersect-checkbox" />');
$("#catlinks ul").last().append('<li class="intersect-item"><button type="button" id="intersect-button">Find similar pages</button></li>');
mw.util.addCSS('#catlinks li.intersect-item {border-left: none}');
$("#intersect-button").click(function() {
var outList = "", outCount = 0;
$("#catlinks .intersect-checkbox:checked + a").each(function() {
outList += (outCount++ ? '::' : '') + $(this).text();
});
if (outCount == 0) {
alert("You must select at least one category to find similar pages.");
return;
} else if (outCount == 1) {
window.location = mw.util.getUrl('Category:' + outList);
} else {
window.location = mw.util.getUrl('Intersection:' + outList);
}
$(this).text("Redirecting...");
});
});
Text on the Preferences page Gadgets tab
Create MediaWiki:Gadget-intersection and add the following text:
Enable the Category Intersection (Catisect) gadget
Using the gadget
For users to be able to use the gadget, they must enable it via their personal user Preferences, on the Gadgets tab.
The default installation of this extension and the accompanying gadget add a button to the Category links (#catlinks) section at the bottom of the wiki page. Checking the boxes by multiple categories and clicking the "Find similar items" button directs the user to the corresponding Intersection page.
The following is a view of the category links section when the gadget is enabled:
Customizing the gadget
The text shown on the button can be changed by editing the JavaScript shown above ("Find similar pages"), and the button itself can be styled using the button selector. Unstyled buttons are rectangular with a light grey background.