在MediaWiki中包含类别 [英] Transclude a category in MediaWiki

查看:71
本文介绍了在MediaWiki中包含类别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不确定在MediaWiki中是否可行.

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. 用户定义的文本(可以使用编辑链接进行编辑).
  2. 该类别的所有子类别.
  3. 此类别所附的所有页面.

我的目标是创建一个至少包含几个类别的第3部分的页面.一个页面,显示我所选择的多个类别所附的所有页面名称,并按其类别分组.

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.

我的第一种方法是使用MediaWiki的标准transclude语法:

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}}
    ...

不幸的是,这仅包括类别的#1部分:用户定义的文本.页面名称列表丢失.

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.

也许那里有MediaWiki扩展...

Perhaps there is a MediaWiki extension out there...

有一个聪明的方法来实现这一点吗?

Is there a clever way to realize this?

推荐答案

尝试 http://www .mediawiki.org/wiki/Extension:CategoryTree ,具有以下语法:

Category A contains these pages:
<categorytree hideroot="true" namespaces="-">Category A</categorytree>

这篇关于在MediaWiki中包含类别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆