Extension:CategoryMagicWords
This extension stores its source code on a wiki page. Please be aware that this code may be unreviewed or maliciously altered. They may contain security holes, outdated interfaces that are no longer compatible etc. Note: No localisation updates are provided for this extension by translatewiki.net . |
This extension is currently not actively maintained! Although it may still work, any bug reports or feature requests will more than likely be ignored. |
![]() Release status: unmaintained |
|
---|---|
Implementation | Parser extension |
Description | Adds some magic words to change the behaviour of category pages. |
Author(s) | Säsongsmat.nu (Rotseetalk) |
Latest version | 0.1.3 (2012-12-29) |
MediaWiki | 1.17+ |
PHP | 5.3+ |
Database changes | No |
License | BSD 2-clause "Simplified" License |
Download | see here |
Example | säsongsmat.nu |
The CategoryMagicWords extension allows you to hide the pages and/or the subcategories from category pages, if you want to replace them with some custom code (e.g. using Extension:Semantic MediaWiki). The extension overrides some MediaWiki functions, and will probably interfere with other extensions working in the same way (notably Extension:CategoryTree).
UsageEdit
The magic words __CATEGORYNOPAGES__ and __CATEGORYNOSUBCATS__ on a category page will supress the pages and subcategories respectively. For image galleries, there is already a builtin magic word for that, __NOGALLERY__.
The parser function {{#parentcategories:}}
will display the categories a page belongs to, in a comma separated list of links internal. Define a parameter "lcfirst" to lower case first letter: {{#parentcategories:Category:Child}}
=> Parent, while {{#parentcategories:|lcfirst}}
=> parent. {{#parentcategories:}}
will do the same as {{#parentcategories:Extension:CategoryMagicWords}}
.
You might want to change the message in MediaWiki:Category-empty if using this extension.
InstallationEdit
You can also cut and paste the code from CategoryMagicWords.php and CategoryMagicWords.i18n.php and move them into your extensions folder, then add the following to LocalSettings.php:
require_once( "$IP/extensions/CategoryMagicWords/CategoryMagicWords.php" );
ChangelogEdit
- 0.1.3
- Changed minimum PHP requirement to 5.3
- Code formatting
- 0.1.2
- Introducing parser function #parentcategories
- 0.1.1
- Cleaned up the code
- Removed support for MagicWordMagicWords (MW <=1.6.0)
- i18n-file
- 0.1 First version
TodoEdit
- Don't output MediaWiki:Category-empty if category is not really empty.
- Is it possible to achieve this using the CategoryView hook? Would be good, so that this extensions does not interfere with CategoryTree or other extensions, that might now see some of their category page functionality overridden.
- Add I18n for magic words
- Check compatibility with other MediaWiki versions.