tags:

views:

376

answers:

2

I'm not quite sure if this is possible in MediaWiki.

I've got several categories, each containing a few pages. If you open a category page you'll see the contents of the category that usualy consists of these three parts:

  1. A user defined text (which can be edited by using the edit link).
  2. All subcategories that are attached to this category.
  3. All pages that are attached to this category.

My goal is to create a page that includes at least part #3 of several categories. A page that shows me all page names that are attached to multiple categories of my choosing, grouped by their category.

My first approach was to use the standard transclude syntax of MediaWiki:

    Category A contains these pages:
    {{:Category:A}}
    Category B contains these pages:
    {{:Category:B}}
    Category C contains these pages:
    {{:Category:C}}
    ...

Unfortunatly, this only transcluded part #1 of a category: the user defined text. The page name listing was missing.

My second idea was to have a look at the parser functions. Perhaps there are some functions that offer enumerating through the pages of a category. But I didn't find any.

Perhaps there is a MediaWiki extension out there...

Is there a clever way to realize this?

+1  A: 

Try http://www.mediawiki.org/wiki/Extension:CategoryTree, with the following syntax:

Category A contains these pages:
<categorytree hideroot="true" namespaces="-">Category A</categorytree>
Joshua C. Lerner
Thanks, that is what I was looking for. It's working great.
Typhix
A: 

If you want more control over how the results are displayed, you may want to give Semantic Mediawiki a try.

http://semantic-mediawiki.org/wiki/Semantic_MediaWiki

The syntax would look something like :


Pages in Category A:

{{#ask:[[Category:A]] |format=ul }}


Even if you are not using semantic properties, you can use the query mechanism to display pages based on categories.

Laurent Alquier