ARC中文动保小百科(APpedia)国际水准的动物保护百科全书 - Categories
主页/关于APpedia - 编辑方法 - 小百科最近更新 - 站内搜索 - 关于动物权利的条目 - 在线咨询

 

ARC中文动保小百科(APpedia)是第一本中文的动物保护百科全书,编辑研究员团队包括海内外杰出的动物保护专家和个人。百科主要以在线方式发布(电子书)并长期扩充改进,是希望成为专业动保工作者、动保学者的朋友的必读材料。百科条目覆盖范围广,学术水平一流,核心条目由编辑团队按重要性选择,并征集研究员编写相应的初稿。所有核心条目发表前均通过质量审核程序,内容以介绍国际最前沿的动物保护知识研究为目标。读者可以自由改进和扩充百科内容。

精彩推荐

以下为主要条目

Share |

Categories

阅读[Categories]最新版本请访问:http://APpedia.arc.capn-online.info Copyright © ARC中文动保小百科
版权说明(转载条目必读) ARC中文动保小百科邮件地址:
APpedia@arc.capn-online.info
分类 浏览全部完成的百科条目:http://APpedia.arc.capn-online.info/all

authors (intermediate)

Purpose of Categories

Categories (also known as "tags") are a way to organize and find related pages. Categories are implemented by default in PmWiki 2, and in most wikis they don't require any special code or markup, they're just a useful convention. The idea is that every page that falls into a particular subject area should have a link to a shared page containing links to other pages on that subject. These pages are created in the Category group, and thus these subject areas are called Categories.

Using Categories

Getting Categories to work requires two steps, the first of which is adding links to each Category. A Category named Subject is created by adding a link to Category.Subject on any page. When you add the link to a page, the page can be described as being in the Category "Subject".

There is a special markup for creating these links which makes Categories work more smoothly: [[!Subject]] will create a link to Category.Subject. So [[!Subject]] is a kind of shortcut to the page Subject in the category group.

If you click on the category links on a page, initially you'll just be taken to an empty page named Category.Subject. The second step in setting up Categories is to modify the behavior of pages in the Category group so that they will display a list of all pages containing links to Category.Subject. This is relatively simple to do:

  1. Open the page Category.GroupFooter? for editing
  2. Add the line (:pagelist link=Category.{$Name} list=normal:)
  3. Save the edits

This will cause the footer on every page in the Category group to display a list of links to pages that reference that page in the category group.

It is worth noting that rather than adding this to Category.GroupFooter, the pagelist code could be added to Category.GroupHeader to similar effect; it just depends on whether you'd prefer to have the list of pages appear before or after any text that you add to the individual category pages (which can be edited just like normal pages).

Because we use the normal PageList link= markup, you can use it not only in the category group. If you want to show all pages belonging to the category Subject you can use on any wiki page (:pagelist link=Category.Subject list=normal:).

Similarly, there's no requirement that a "category page" has to be in the Category group -- any page can define a "category" of pages that link to it.

An administrator can override the default category group name of "Category" by setting the $CategoryGroup variable in config.php to another group name.

Recap

So, by adding the link [[!Subject]] to a page, a link to that page will automatically appear on the page Category.Subject, as long as the GroupFooter for the Category group has been tweaked appropriately. Thus, you can create a page that automatically creates an alphabetized list of all movies discussed on your wiki by creating links to [[!Movies]] on each film's page; the resulting automatic list would be on the page Category.Movies.

authors (advanced)

Category Nesting

Categories have the potential for even greater usefulness because Category.* pages can themselves be placed into categories! To follow an excellent example from John Rankin, let's suppose we have the following film pages in the categories listed to the right:

Film.ShaunOfTheDead    [[!Horror]] [[!Comedy]] [[!2003]]
Film.InMyFathersDen   [[!Drama]] [[!2004]]
Film.TheCorporation   [[!Documentary]] [[!2003]]

Now then, we can create Category.Horror, Category.Comedy, Category.Drama, and Category.Documentary, and in each one of those pages we put [[!Genre]]. In Category.2003 and Category.2004, we put [[!Year]].

So, what happens when we display Category.Genre ? We see links to "Comedy", "Drama", "Documentary", and "Horror", because they're in the Genre category. When we click on one of those links, we see all of the films listed in one of those categories. Similarly, if we click on Category.Year, we see links to "2003" and "2004", each of which in turn displays the list of films for that year.

Finally, in Category.Genre and Category.Year we can put [[!Category]], which makes them "top-level" categories reachable from the Category.Category page. Voila, we now have an instant "hierarchy":

Category.Category
    Category.Genre
        Category.Comedy
            Film.ShaunOfTheDead
        Category.Drama
            Film.InMyFathersDen
        Category.Documentary
            Film.TheCorporation
        Category.Horror
            Film.ShaunOfTheDead
    Category.Year
        Category.2003
            Film.ShaunOfTheDead
            Film.TheCorporation
        Category.2004
            Film.InMyFathersDen

Note however that this isn't a "strict" hierarchy--i.e., any page or category can appear simultaneously in multiple categories. For example, Category.Documentary could be a member of both the Genre and top-level category listings.

Each category page can have content text before the generated list, e.g., to give a generic description of things in the category. (Or it can be empty, which works fine.) It can also contain associations to related categories ("see also" references). For example, in a tourism wiki, the ''bed and breakfast" category might contain a see-also reference to the "self-catering" category.

administrators (intermediate)

The Guts of the Category Markup

As mentioned, all of the necessary markup features for Categories are enabled by default in current releases of PmWiki 2.0, but here's how they work for those who are interested. The use of the Category group as the repository for all categories is determined by setting the $CategoryGroup variable, and the special [[!Subject]] markup is activated by a call to the Markup() function:

SDV($CategoryGroup,'Category');
Markup('[[!','<links','/\[\[!([^\|\]] ?)\]\]/',
  "<span class='category'>[[$CategoryGroup/$1]]</span>");

Coming Up With Good Category Schemes

The hard part about using categories is choosing a good vocabulary. Site content managers may wish to follow the Guidelines for the establishment and development of monolingual thesauri (ISO 2788-1986) and the Guidelines for the establishment and development of multilingual thesauri (ISO 5964-1985). Questions to think about include:

  • whether a scheme already exists and can be reused
  • number of levels in a multilevel scheme (not too shallow, not too deep -- e.g. 3)
  • number of categories per page (not too many, not too few -- e.g. 3)
  • consistent use of singular ([[Mercury]] is a [[!planet]]) or plural ([[Mercury]] is in the [[!planets]] category)
  • disambiguation and use of phrases ([[!musical instruments]] and [[!medical instruments]]) or Cookbook:Subpage Markup ([[!Instruments*Musical]] and [[!Instruments*Medical]])

Or you can just let people use whatever category terms they find meaningful. A vocabulary (or "folksonomy") will emerge over time.

Contributors

Radu, John Rankin, SolaRoofGuy, David A Spitzley

<< Passwords | DocumentationIndex | Page lists >>

主页(关于ARC中文动保小百科) - 编辑使用手册 - 小百科最近更新 - 在小百科内搜索(使用Google)
本文最后更新于 2006 年 08 月 25 日, 11:53 上午

Animal Rights, New Welfarism, Reverence for Animals, Animal Welfare, Naturalness, Autonomy of Animals, Animal Experimentation, Wildlife Protection, Spiritual Power of Animals, and more...

free stats