Help:Category

From Wiktionary, the free dictionary
Jump to navigation Jump to search
See also Wikimedia's Meta-Wiki for this page.
See also: Categories

Quick help:

  • To add an entry to a category, place [[Category:Category name]] on the page.
  • To see all the entries in a category, follow (that is, click on) the hyperlink with the category name located at the bottom of the page.

The categorization facility provided by the MediaWiki software is a powerful tool for automating the creation of lists. Whenever you think of creating a list of words, consider creating a category instead. Unlike lists, categories are updated automatically. There is no need, as there is with lists, to maintain links in two places - the list and the individual entries within it. Categories are very useful for finding similar words or subjects and for finding "gaps".

How-to[edit]

How to add pages to categories[edit]

The most basic way to add a page to a category is to simply add a wikilink to the full category title. For example, if you wished to add the entry for apple to Category:en:Fruits, you would simply edit the English section of the entry and add [[Category:en:Fruits]] at the bottom.

The category link will not appear in the text of the entry. Instead, a link to the category will appear in a box at the bottom of the entry, and the category page Category:en:Fruits will contain a link to the apple entry.

In entries with multiple language sections, place category links inside the appropriate section. A category relating to English goes in the English section, one relating to Chinese goes in the Chinese section, and so on. (Wiktionary does not put all of the category links at the bottom of the page as Wikipedia does.)

In many cases, categories are added automatically by templates. For example, the {{en-noun}} template adds the entry apple to Category:English nouns.

The following categorisation templates are used in many Wiktionary entries:

How to link to categories[edit]

To display a category link, put a colon before the full page name in the wikilink. For example, to create the link Category:Languages, enter [[:Category:Languages]]. Using [[Category:Languages]] with no colon at the beginning does not display a link; it simply puts the page in the category.

How to create a category[edit]

If a category link appears red when you add the category to a page, this means that category has not yet been used. Simply click the red link, add the text {{auto cat}} to the page, and click "Show preview". If the preview contains the usual description expected for this category, go ahead and press "Publish changes". Otherwise, you may need to configure a new category, as explained below.

Wiktionary's category infrastructure is more complex than on most other wikis. The category hierarchy is for the most part defined in Lua modules.

To create a new category, you will first have to enter some metadata about the category (at minimum, the name, description, and parent category) on a page under Module:category tree. If you wish to make a topic category, choose an appropriate subpage under Module:category tree/topic cat. Otherwise, choose from among the subpages of Module:category tree/poscatboiler/data.

For example, if you wished to make a topic category for unicycling, the most appropriate module would be Module:category tree/topic cat/data/Transport. You would then add (in the appropriate position, alphabetically) something like:

labels["unicycling"] = {
	description = "{{{langname}}} terms related to [[unicycle]]s and [[unicycling]].",
	parents = {"cycling"},
}

Generally, it should be straightforward to pattern the entry for your new category off of existing examples, but you can find detailed documentation for all the possible fields and their syntax at Module:category tree/poscatboiler/data/documentation.

Editing a category description[edit]

To edit a category description, you visit the category page, for example Category:Unicycling, and click the "Edit category data" link. This takes you to the relevant Lua module where the category is defined. Use your browser's "find" function to locate the category's entry in the Lua module and edit the description as required. Note that the description defined in the Lua module is reused on many category pages, so do not add information that is specific to one language.

Creating category pages[edit]

Navigate to the category page you wish to create (e.g. Category:Unicycling). Note that (unlike the main and template namespaces) category pages are always capitalized, even if you specified a lowercase string label in the module data. In most cases, category pages can simply be created with the content {{auto cat}}. For more information, see the documentation for {{auto cat}} and see Category:Category boilerplate templates for a list of the "category boilerplate template" templates (catboiler templates for short) which are added by {{auto cat}}.

In most cases (unless you created a language-specific category, somewhere under Module:category tree/poscatboiler/data/lang-specific) you will need to create an "umbrella category" (e.g. Category:Unicycling) and separately create language-specific category pages for each language you intend to populate (e.g. Category:en:Unicycling). Non-topic categories use a different naming scheme — for example, if we had added a category with label "unicycling slang" at Module:category tree/poscatboiler/data/terms by usage, this would give rise to umbrella category Category:Unicycling slang by language, with language-specific subcategories having names like Category:Korean unicycling slang. When in doubt, it may be helpful to observe the structure of similar existing categories.

Be aware that because of caching and delayed updates, additions to categories may not appear immediately, and when creating category pages the red hyperlinks at the bottom of categorized entries may not immediately turn blue. The changes usually take a few minutes to appear. Changes to the structure of the category tree may take longer to appear. For example, after creating Category:Unicycling, it may take several hours for it to appear as a subcategory on the Category:Cycling page. You can force an immediate update by performing null edits on the affected categories.

Oriented graph[edit]

The MediaWiki software does not require that categories form a strict hierarchy. In general, it allows them to form a directed graph. However, with the exception of the maintenance categories, on Wiktionary the intent is for the categories to form an oriented graph with a single root at Category:Fundamental.