Week13.1(5.27Mon) Help:Category (YANGPEIFU)

1. Summary

  The MediaWiki software maintains tables of categories, to which any editable page can be added. To add a page to a category, include "[[Category: Category name]]" or "[[Category: Category name|Sortkey]]" in that page's wiki markup. The categories to which a page belongs appear in a box at the bottom of the page. A category is usually associated with a category page in the "Category:" namespace. ( The category itself is permanently created as soon as it has been saved onto any page. Unless you make a category page, it will display as a red link. Unless you add another category to the category page, it will not be placed in the category tree. Category pages are created like any other page. Most commonly, editors click on the redlink in an article and create the category page that way.)A category page contains text that can be edited, like any other page. Still, when the page is displayed, the last part of what is shown is an automatically generated list of all pages in that category, in the form of links. Other category pages which appear in this list are treated separately, as subcategories

Category pages are pages in the "Category" namespace intended to group pages about related topics together, making them easier for readers to find and navigate. Each category page contains three sections: Subcategories, Pages, and Media. The Subcategories section lists other "category" pages and can be expanded or collapsed for viewing. The Pages section lists the pages in the category (excluding subcategories and images), while the Media section displays images and other media in the category, including thumbnails and file sizes. Pages are added to categories by using the `[[Category: category name]]` or `[[Category: category name|sort key]]` syntax in their markup. Typically, these category declarations are placed at the end of the page, but before templates and cross-language links. Hidden categories use the `__HIDDENCAT__` magic word to make them invisible to normal readers, but registered users can choose to show hidden categories. Category pages can be edited, moved, and redirected like other pages. Moving a category page leaves a redirect behind, and category redirects are created using the `{{category redirect}}` template. Templates can also be used for categories, by using the `<includeonly>` tag in the template to add pages to the category, which is particularly useful for categories with high turnover or containing many pages. Users can query category information through the API to obtain category members and their sort keys and timestamps. Displaying category trees and page counts can be achieved through the `<categorytree>` tag or the corresponding template to help visualize the category hierarchy. Monitoring category changes is achieved through the "Classification Changes" filter on the Recent Changes page, which includes tracking the addition and removal of categories. Users can find pages in a specific category through the search function by using `in category: "category name"` in the search box. You can find related articles using the "Link Here" tool, related lists, or the PetScan tool. These features help keep the classification accurate and updated and improve the efficiency of finding information and the overall navigation experience.

2. Project

Namespaces
Subject namespacesTalk namespaces
0(Main/Article)Talk1
2UserUser talk3
4WikipediaWikipedia talk5
6FileFile talk7
8MediaWikiMediaWiki talk9
10TemplateTemplate talk11
12HelpHelp talk13
14CategoryCategory talk15
100PortalPortal talk101
118DraftDraft talk119
710TimedTextTimedText talk711
828ModuleModule talk829
Former namespaces
108BookBook talk109
442CourseCourse talk443
444InstitutionInstitution talk445
446Education ProgramEducation Program talk447
2300GadgetGadget talk2301
2302Gadget definitionGadget definition talk2303
2600Topic2601
Virtual namespaces
-1Special
-2Media
Current list (API call)

Pages in the "Category" namespace.

Main sections: subcategories, pages, media.

Subcategories section: lists other category pages, expandable/collapseable.

Pages section: lists categorized pages (excluding subcategories and images).

Media section: displays images and other media in a category, with thumbnails and file sizes.

Syntax: `[[Category:category name]]` or `[[Category:category name|sort key]]`.

Location: usually at the end of the page, but before templates and cross-language links.

Hide categories: use the `__HIDDENCAT__` magic word.

Edit: edit category page content like a normal page.

Move and redirect: moving a category page will leave a `{{category redirect}}` redirect.

Use template categories: use the `<includeonly>` tag in a template for categories.

API queries: get category members, their sort keys, and timestamps.

Show category tree: use the `<categorytree>` tag or the corresponding template to display the category tree and page counts.

Monitor changes: Monitor category additions and deletions in the Recent Changes page with the "Category Changes" filter.

Search categories: Use `in category:"category name"` in the search box to find pages in a specific category.

Use the "Link Here" tool, related lists, or the PetScan tool to find articles that might belong in a category.

Default Sort Key: Use `{{DEFAULTSORT: sort key}}` to set the default sort key.

Template Categories: Add pages to categories via templates, and use the `<includeonly>` tag to control category declarations.

Hidden categories: Hidden categories for project maintenance, are not visible to normal readers.

3. Question

How can I add a page to a category via a template and ensure that the category declaration only takes effect when the page is included by the template?



Comments

  1. How can sort keys be effectively used to order pages within a category?

    ReplyDelete

Post a Comment

Popular posts from this blog

Introduction to the blog

W10.2 May 10 (Fri)—CHENG SHIYI

W1.1 Intro class: intro to class, blog, wiki and other assignments——CHENG SHIYI