2006-07-28 16:07:55 +00:00
|
|
|
--------------------------------------------------------------------------
|
2006-07-29 16:18:40 +00:00
|
|
|
README for the CategoryTree extension
|
2007-03-13 11:39:12 +00:00
|
|
|
Copyright © 2006-2007 Daniel Kinzler
|
2006-07-28 16:07:55 +00:00
|
|
|
Licenses: GNU General Public Licence (GPL)
|
|
|
|
GNU Free Documentation License (GFDL)
|
|
|
|
--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
The CategoryTree extension provides a dynamic view of the wiki's category
|
|
|
|
structure as a tree. It uses AJAX to load parts of the tree on demand.
|
|
|
|
|
|
|
|
<http://meta.wikimedia.org/wiki/CategoryTree_extension>
|
|
|
|
|
|
|
|
The CategoryTree extension was originally written by Daniel Kinzler in
|
|
|
|
2006 and is released under the GNU General Public Licence (GPL). The
|
|
|
|
internationalization files contain contributions by several people;
|
2006-09-01 12:53:07 +00:00
|
|
|
they are mentioned in each file individually. Also thanks to Tim Starling
|
|
|
|
for his contributions.
|
2006-07-28 16:07:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
INSTALLING
|
|
|
|
--------------------------------------------------------------------------
|
|
|
|
|
2006-07-29 16:18:40 +00:00
|
|
|
Copy the CategoryTree directory into the extensions folder of your
|
2006-07-28 16:07:55 +00:00
|
|
|
MediaWiki installation. Then add the following lines to your
|
|
|
|
LocalSettings.php file (near the end):
|
|
|
|
|
|
|
|
$wgUseAjax = true;
|
2007-09-21 12:47:05 +00:00
|
|
|
require_once( "{$IP}/extensions/CategoryTree/CategoryTree.php" );
|
2006-07-28 16:07:55 +00:00
|
|
|
|
2007-09-21 12:43:56 +00:00
|
|
|
Note that $wgUseAjax = true; will enable the Ajax framework in MediaWiki,
|
|
|
|
which is required by the CategoryTree extension. Ajax is a term for using
|
2006-07-28 16:07:55 +00:00
|
|
|
JavaScript to load parts of a page on demand. It is supported by all
|
2007-09-21 12:43:56 +00:00
|
|
|
recent graphic web browsers. For more information about Ajax see
|
2006-07-28 16:07:55 +00:00
|
|
|
<http://en.wikipedia.org/wiki/Ajax_%28programming%29>.
|
|
|
|
|
|
|
|
|
|
|
|
USAGE
|
|
|
|
--------------------------------------------------------------------------
|
|
|
|
|
2006-09-01 12:53:07 +00:00
|
|
|
CategoryTree can be used in three ways: directly on the category pages,
|
|
|
|
as a "custom tag" to show a category structure inline on a wiki page,
|
|
|
|
and as a special page.
|
2006-07-28 16:07:55 +00:00
|
|
|
|
2006-09-01 12:53:07 +00:00
|
|
|
The CategoryTree extension replaces the subcategory section of category
|
|
|
|
pages with a dynamic tree view. If Javascript is disabled, this appears
|
2006-09-03 11:26:57 +00:00
|
|
|
as a plain list. The dynamic subcategory entries can be disabled using
|
|
|
|
the URL parameter "notree" - this is intended for bots that rely on
|
|
|
|
parsing the HTML of category pages.
|
2006-07-28 16:07:55 +00:00
|
|
|
|
|
|
|
The custom tag is called <categorytree>. For example, if you put
|
2007-09-13 10:23:45 +00:00
|
|
|
<categorytree mode="pages">Foo</categorytree> on a wiki page, it will show
|
|
|
|
the contents of category Foo as a dynamic tree on that page. The tag accepts
|
|
|
|
the following attributes, using a HTML-like syntax:
|
2006-07-28 16:07:55 +00:00
|
|
|
|
|
|
|
* hideroot - set this to "on" to hide the "root" node of the tree, i.e.
|
|
|
|
the mention of category Foo from the example.
|
|
|
|
|
2007-03-13 11:39:12 +00:00
|
|
|
* onlyroot - set this to "on" show only the "root" node of the tree initially
|
|
|
|
|
2007-04-30 21:18:56 +00:00
|
|
|
* mode - can be "categories", "pages" or "all". See the Modes section below.
|
|
|
|
The default for this attribute is controlled by
|
|
|
|
$wgCategoryTreeDefaultMode, and is initially set to CT_MODE_CATEGORIES,
|
|
|
|
the equivalent of setting the mode attribute to "categories".
|
2006-07-28 16:07:55 +00:00
|
|
|
|
|
|
|
* style - can be used to specify any CSS styles you would like for the
|
|
|
|
tree.
|
2007-09-13 10:23:45 +00:00
|
|
|
|
|
|
|
Alternatively to the <categorytree> tag, parser-function syntax can also be
|
|
|
|
used, e.g {{#categorytree:Foo|hideroot=yes}}. This syntax allows the use of
|
|
|
|
magic variables, templates and template parameters for the category name.
|
|
|
|
|
2006-09-01 12:53:07 +00:00
|
|
|
The special page is called Special:CategoryTree; there you can enter the
|
|
|
|
name of a category and then browse it's content. The CategoryTree
|
|
|
|
extension also adds a tab for this special page to every category page.
|
|
|
|
|
2006-07-28 16:07:55 +00:00
|
|
|
|
2007-04-30 21:18:56 +00:00
|
|
|
MODES
|
|
|
|
--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
The category tree can be shown in different modes, determining what types of
|
|
|
|
"leaves" the "tree" has:
|
|
|
|
* categories (constant CT_MODE_CATEGORIES): show subcategories only
|
|
|
|
* pages (constant CT_MODE_PAGES): show subcategories and pages, except images
|
|
|
|
* all (constant CT_MODE_ALL): show all pages, subcategories, images, etc
|
|
|
|
|
|
|
|
The CT_MODE_XXX constants can be used with configuration optiosn (see below).
|
|
|
|
|
2006-07-28 16:07:55 +00:00
|
|
|
OPTIONS
|
|
|
|
--------------------------------------------------------------------------
|
|
|
|
|
2006-07-29 16:18:40 +00:00
|
|
|
There are some options you can specify in your LocalSettings.php file:
|
2006-07-28 16:07:55 +00:00
|
|
|
|
|
|
|
$wgCategoryTreeMaxChildren - maximum number of children shown in a tree
|
|
|
|
node. Default is 200
|
|
|
|
|
|
|
|
$wgCategoryTreeAllowTag - enable <categorytree> tag. Default is true.
|
|
|
|
|
|
|
|
$wgCategoryTreeDynamicTag - loads the first level of the tree in a
|
|
|
|
<categorytag> dynamically. This way, the cache
|
|
|
|
does not need to be disabled. Default is false
|
|
|
|
|
|
|
|
$wgCategoryTreeDisableCache - disabled the parser cache for pages with a
|
|
|
|
<categorytree> tag. Default is true.
|
|
|
|
|
2006-08-23 19:23:17 +00:00
|
|
|
$wgCategoryTreeHTTPCache - enable HTTP cache for anon users. Default is
|
|
|
|
false.
|
|
|
|
|
2006-11-22 21:48:54 +00:00
|
|
|
$wgCategoryTreeOmitNamespace - never show namespace prefix. Default is
|
|
|
|
false. Patch contributed by Manuel Schneider
|
|
|
|
<manuel.schneider@wikimedia.ch>, Bug 8011
|
|
|
|
|
2007-03-13 22:24:38 +00:00
|
|
|
$wgCategoryMaxDepth - maximum value for depth argument; can be an integer,
|
2007-04-30 21:18:56 +00:00
|
|
|
or an associative array, mapping CT_MODE_XXX constants
|
|
|
|
to the maximum depth for that mode.
|
|
|
|
Ignored if $wgCategoryTreeDynamicTag is true. Introduced
|
|
|
|
by Steve Sanbeg.
|
2007-03-13 22:24:38 +00:00
|
|
|
|
2007-04-06 10:30:43 +00:00
|
|
|
$wgCategoryTreeExtPath - the (URL-) path where the extension is installed,
|
|
|
|
relative to $wgScriptPath, with leading "/". Default is
|
|
|
|
"/extensions/CategoryTree".
|
|
|
|
|
2007-04-30 21:18:56 +00:00
|
|
|
$wgCategoryTreeDefaultMode - the default mode to use when no mode attribute
|
|
|
|
is specified in a <categorytree> tag. May be
|
|
|
|
CT_MODE_CATEGORIES (the default), CT_MODE_PAGES, or
|
|
|
|
CT_MODE_ALL.
|
|
|
|
|
|
|
|
$wgCategoryTreeCategoryPageMode - the mode to use when rendering trees on
|
|
|
|
category pages. May be CT_MODE_CATEGORIES (the default),
|
|
|
|
CT_MODE_PAGES, or CT_MODE_ALL.
|
|
|
|
|
2006-07-28 16:07:55 +00:00
|
|
|
--------------------------------------------------------------------------
|
2007-03-13 22:24:38 +00:00
|
|
|
EOF
|