On Wikis with two or more content namespaces, categories don't look so nice because all articles of a namespace (say Help:) are grouped under "H" by default.
This patch introduces the option to completely ignore the namespace for sorting in category pages.
- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -2114,6 +2114,12 @@ $wgCategoryMagicGallery = true;
$wgCategoryPagingLimit = 200;
/
+ * Sort pages in categories by namespace first (e.g. group all Talk pages together)
+ * Warning: This will only affect newly saved pages!
+ */
+$wgUseNamespaceInCategorySort = true;
+
+/
- Browser Blacklist for unicode non compliant browsers
- Contains a list of regexps : "/regexp/" matching problematic browsers */
- a/includes/Parser.php
+++ b/includes/Parser.php
@@ -4866,10 +4866,11 @@ class Parser
- @return string */ public function getDefaultSort() {
+ global $wgUseNamespaceInCategorySort;
if( $this->mDefaultSort !== false ) { return $this->mDefaultSort; } else {
- return $this->mTitle->getNamespace() == NS_CATEGORY
+ return ($this->mTitle->getNamespace() == NS_CATEGORY || !$wgUseNamespaceInCategorySort)
? $this->mTitle->getText() : $this->mTitle->getPrefixedText(); }
Comments?
Version: 1.12.x
Severity: enhancement