Community Central
Community Central
No edit summary
(remove legacy info)
Tags: Source edit Help
(41 intermediate revisions by 25 users not shown)
Line 1: Line 1:
  +
[[file:CategoriesUnfurled.png|thumb|right|275px|Categories seen at the top of the page, including a view of the drop-down when you click on "more"]]
 
{{tocright}}
 
{{tocright}}
  +
A '''category''' is a navigational tool used in MediaWiki to group similar pages together and structure the wiki, making it easier to explore and use. They can be used to group not only articles, but also templates, images, and even users.
{{Needs editor update}}
 
A '''category''' is a group of pages with a similar theme, such as characters, books, or places. You can add a category link to any page, and it will automatically be listed on a category page with other similarly linked pages. Categories perform as navigational tools both in the [[User blog:Brandon Rhea/New Page and Article Headers: Official Release Date|article header]] and at the bottom of the page.
 
   
  +
Categories can be found in the [[w:User blog:Brandon Rhea/New Page and Article Headers: Official Release Date|article header]] and at the bottom of the page.
[[File:Categories_in_an_article_header_.png|center|Categories perform as navigational tools in the article header|400px]]
 
   
  +
== Why are categories important?==
Categories help organize the community and make it easier for readers to find related content. They also allow you to put together a [[Help:Mobile Main Page|mobile main page]] for visitors on phones or tablets. Ideally, every wiki page should be in at least one category. A category page itself can be in another category. So, for example, a wiki might have a category called "Characters" with sub-categories for "Minor characters", "Dead characters", and "Main characters".
 
  +
Categories are the basic tool for structuring wikis: They help organize the content, navigate the pages, and find related content. Ideally, every wiki page should be in at least one category.
   
  +
Categories themselves can be categorized within ''other'' categories, allowing you to create a [[Special:CategoryTree|category tree]] of interlinked categories that make exploring the wiki much easier.
At the bottom of each page, there is a set of "Related Pages" images to help guide visitors from one page to another. These are chosen based on category tags on each page. The more specific the category tags are, the better these suggestions will be.
 
   
  +
:''For example: A reader browses through a TV series wiki and opens a page on Jessica Protagonist. She is categorized as one of the '''Main characters'''. The reader can open that category and then move up to the higher level '''Characters''' category to explore '''Minor characters''' or '''Characters by season'''. The '''Characters''' category acts as the trunk of the category tree from which other categories branch off. Without the category, the reader would have to know the specific name of a character to find an article about them.''
== How to add a page to a category ==
 
A page appears in a category when a category link is added to that individual page. You cannot add pages to a category from the category's listing page.
 
   
  +
There is another reason for using categories: Categorization is essential for several core features of Fandom wikis, including:
=== From the page ===
 
  +
* The [[Help:Mobile Main Page|mobile main page]], which uses categories as building blocks.
[[File:CategorySelect suggest.png|thumb|center|600px|Adding a category, with suggestions]]
 
  +
* [[Help:DynamicPageList|DynamicPageList]], which generates lists based on categories.
At the bottom of the page where categories are listed, you are presented with the ability to add a category without hitting the edit button.
 
  +
* The "Related Pages" module, which displays pages based on their categories.
* Click on the "Add category" button, and start typing in a category name.
 
  +
* Many [[Help:Bots|bot]] usages.
* You can use an already established category (suggestions will appear as you type) or add a new one.
 
  +
  +
Without categories, they simply won't work.
  +
 
== How to add a category? ==
  +
To add a category, begin by going to the page you wish to categorize. Then use either the '''category module''' at the bottom of the page or an '''editor''', to add your category.
  +
 
=== Using the category module ===
  +
  +
[[File:Category Module.png|thumb|This is category list, located under article, where there is "Add Category" button|300px]]
  +
  +
The '''category module''', if enabled, allows you to add categories without opening the editor. Simply scroll down to the bottom of a page and:
  +
 
* Click on the '''Add category''' button, and start typing in a category name.
 
* You can use an already-established category (suggestions will appear as you type) or add a new one.
 
* Once you are done, hit save and the category will appear on the article.
 
* Once you are done, hit save and the category will appear on the article.
   
If you would prefer not to use this ability, you can disable it by going to your [[Special:Preferences|personal preferences]]. Once there, click on the '''editing''' tab, check the box next to "Disable Category module" and then save your preferences.
+
If you don't use the module, you can disable it through the [[Special:Preferences|preferences page]]. Just click on the '''Editing''' tab, check the box next to '''Disable Category module''' and then save your preferences.
   
 
=== While editing ===
 
=== While editing ===
  +
There are various ways to add categories while editing the wiki, depending on which editor you use.
[[File:Adding category edit mode.png|thumb|250px|Adding, removing or editing a category from the editor]]
 
On the right hand side of the editor is a '''Categories''' module. Click to expand this and you will see a list of the categories already present.
 
* To add a category, type the category name in the input area above the existing categories. As you type, you will see suggestions appear.
 
* Click the pencil next to each category to edit that category's settings.
 
* Click the trash can to remove the category.
 
   
  +
; Visual Editor and Source editor
While in source mode, you can add the category name as a link to the bottom of the page itself (e.g. <code><nowiki>[[Category:Help]]</nowiki></code>), or use the category module. Existing categories will not appear at the bottom of the page in source mode; you must check the category module for existing categories.
 
  +
[[file:UCP_editor_categorization.png|right|275px|thumb|The editor interface.]]
  +
The editor allows for switching between '''Source Editing''' and '''Visual Editing'''.
  +
* In Source Editing mode, you simply add the category link to the article: <code><nowiki>[[Category:Help]]</nowiki></code> will add a page to the Help category.
  +
* In Visual Editing mode, you can click on the Categories button in the drop-down menu on the right. This opens the category dialogue, which allows you to edit categories, add new ones, and optionally customize how the article should be sorted.
   
  +
To commit changes, simply save the page.
=== Sort parameters ===
 
  +
{{-}}
  +
  +
=== How to sort articles in categories? ===
 
*When clicking the edit icon next to category names, you can define a "sortkey" for that category. This sortkey defines at what point the article appears in a category page's listings, e.g., sort a ''first last'' name page under ''last'' name.
 
*When clicking the edit icon next to category names, you can define a "sortkey" for that category. This sortkey defines at what point the article appears in a category page's listings, e.g., sort a ''first last'' name page under ''last'' name.
  +
:''For example, you can use'' <code><nowiki>[[Category:Help]]</nowiki></code> ''to add a page to the Help category. To customize the sorting, you can use'' <code><nowiki>[[Category:Help|Custom name]]</nowiki></code> ''or'' <code><nowiki>[[Category:Help| ]]</nowiki></code> ''to force the article to display at the top of the page.''
*If an article ''example'' is the introduction for category ''example'', a blank (space) or '''<kbd>*</kbd>''' (asterisk) sortkey puts it near the begin of the category.
+
*If an article ''example'' is an introduction for category ''example'', a blank (space) or '''<kbd>*</kbd>''' (asterisk) sortkey puts it near the beginning of the category.
*If the article is in many categories, you can add <code><nowiki>{{DEFAULTSORT:<sort key>}}</nowiki></code> in the article while editing in [[Help:Source edit mode|source mode]] to sort the article in all the categories the same way. This will save you from having to edit each category's parameters individually.
+
*If the article is in many categories, you can add <code><nowiki>{{DEFAULTSORT:<sort key>}}</nowiki></code> in the article while editing in [[Help:Source editor|source editor]] to sort the article in all the categories the same way. This will save you from having to edit each category's parameters individually.
   
== Category pages ==
+
== How to use category pages? ==
  +
[[File:Categorical Pseudo-existence.png|thumb|right|When pages are in a category that hasn't been fully created]]
=== How to create category pages ===
 
Adding a category to a page - say, "Transylvanian vampires" — begins the process of creating a category, but it doesn't create the page called "Category:Transylvanian vampires". You can view the category by clicking the category name at the bottom of the regular page.
+
As soon as you add a category to a page, that category will appear in [[Special:Categories]]. You can reach the category page by clicking on the category link, or by entering the address into your browser.
   
  +
However, the category page still needs to be created in order to be a part of the [[Special:CategoryTree|category tree]], be available for selection on the [[Help:Mobile Main Page|Mobile Main Page]], and be suggested when editing.
If you wish to add text or other categories to the category page itself (such as an explanation of the types of pages included), then go to the category page and click the "Create" button to create it. Edit it as you would a normal wiki page, and click "Publish". Your text will appear at the top of the page, followed by the list of pages in that category.
 
   
 
To do this, you need to create the category page.
=== How to delete category pages ===
 
To delete a category, first remove the category tag from all pages in the category as described above.
 
   
 
=== Creating a category page ===
An admin can then delete any content on the category page itself by using the "Delete" option in the Edit menu dropdown, the same way a [[Help:Delete|regular page is deleted]].
 
  +
You can either create categories in advance, by starting a new page under the desired category name (<code><nowiki>Category:Target name</nowiki></code>) in any of our editors, or by adding the category to a page and then clicking on the category link or using [[Special:WantedCategories]].
   
  +
Category pages are created like any other page on a wiki and categorized in the same fashion.
A category page that has not been created will display the "Create" button in the top right corner of the page. In this case, the category listing can be deleted simply by removing it from all pages it was on. The category will then no longer appear in the list of categories (Special:Categories) and is fully deleted.
 
   
  +
:''For example, if your wiki is about the Marvel Universe, and you're starting a category about female heroes in the Marvel ''Cinematic'' Universe (aka Earth-199999), you can create the category '''Female superheroes (Earth-199999)''' in this manner:
=== Category presentation ===
 
  +
:<code>'''Female superheroes of Earth-199999'''<nowiki> came from every part of that Earth, exhibiting a wide range of powers, both meta—human and mortal. This category collects pages on this wiki about them, as well as many images and videos featuring their exploits.
;Category Gallery
 
* By default, all categories on FANDOM have a Category Gallery at the top of the category page itself. This shows a small image and link for each of the 8 most popular pages in that category. The image shown is usually the first image on each page.
 
* If a page has no suitable graphics, then the first few lines of text will appear. Suitable images must be:
 
** Larger than 130px by 115px
 
** Used ten or fewer times on the wiki in content namespaces
 
** ''Not'' an SVG
 
   
  +
[[Category:Earth-19999]]</nowiki></code>''
* If you have a community where this display does not work well, you can add the [[Help:Magic words|magic word]] <code><nowiki>__NOCATEGORYGALLERY__</nowiki></code> to the top of the page to remove it. You can also request that it be disabled on all pages through [[Special:Contact]].
 
   
  +
Once published, the category will appear under '''Earth-19999''' and become available in the category module, [[Help:Bots|all bots]], [[Help:DynamicPageList|DynamicPageList]], the [[Help:Mobile Main Page]], and other features.
; <div id="Category_Exhibition"></div>Category Exhibition
 
* This is an optional display method for category pages. It can be turned on by admins using [[Help:Wiki Features|Wiki Features]].
 
* In the exhibition image mode, every page in the category is displayed as an image with a link. Images can be displayed in alphabetical or most visited order.
 
* A small toggle option on the upper right of the page allows users to choose a "list" (lines) or image (squares) view.
 
* In list mode, the category gallery appears above an alphabetical listing of all pages in the category.
 
[[File:CatExhibitionSample.png|thumb|center|500px|A category with Category Exhibition enabled.]]
 
   
  +
:''Note that a category description isn't essential. However, a brief summary will always benefit your wiki's [[Help:SEO|SEO]], as it will be displayed in search results.''
== Advanced notes ==
 
[[File:Over-categorization.svg|thumb|<small style="font:monospace smaller condensed">When category B is better than A (top)</small>]]
 
* For easy administration of the community, it may be desirable to have some categories hidden so that they are not visible on pages by default. In order to do that, you need to add <code><nowiki>__HIDDENCAT__</nowiki></code> on the category page.
 
* You can see a list of all currently used categories for any community on the [[Special:Categories]] page.
 
* Category pages cannot be [[Help:Rename|renamed]] - this is to avoid confusion, as renaming a category page would not change the category on the pages contained within. To rename a category, the category must be changed on all the pages within it.
 
* All pages in normal [[Help:Namespace|namespaces]]&mdash;including [[Special:Uncategorizedpages|articles]], [[Special:Uncategorizedimages|files]], [[Special:Uncategorizedtemplates|templates]], [[Special:Uncategorizedcategories|categories]], user pages, and help pages&mdash;can be in one or more categories.
 
* Talk pages in odd numbered namespaces generally need no category or even should be in no categories.
 
* Some categories are only for files, or only for [[m:Help:Category#Subcategories|sub-categories]], or only for whatever, and if it is not obvious the category page should say how it is supposed to be populated.
 
* Tracking categories are typically hidden, should be (ideally) empty, and are populated automatically or by templates, e.g., [[:Category:Pages with broken file links]].
 
* Four special pages help to identify uncategorized [[Special:Uncategorizedpages|articles]], [[Special:Uncategorizedimages|files]], [[Special:Uncategorizedtemplates|templates]], and [[Special:Uncategorizedcategories|categories]].
 
* Categories are generally arranged as a tree with its root (top-level) at [[:Category:Browse]]. There should be no cycles with a category directly or indirectly belonging to itself.
 
* If category B is a sub- or sub-sub&hellip;-category of A, then no page in B should be also in A, the narrowest category B is the best.
 
* No rules without exceptions, category [[:category:Browse|Browse]] is in [[:Category:Hidden categories|Hidden categories]] is (maybe) in [[:Category:Maintenance|Maintenance]] is in [[:category:Browse|Browse]], that is a cycle, but it is harmless.
 
   
== Where to go next ==
+
=== Deleting a category ===
  +
Categories can be deleted like [[Help:Delete|any other page]], from the Edit menu drop-down panel. However, keep in mind that deleting a page '''does not''' remove it from pages contained within it. You have to delete them manually, either before or after deleting the category.
* Learn how to create [[Help:Templates|Templates]]
 
  +
* Learn how to create [[Help:Infobox|Infoboxes]]
 
  +
As long as a single page remains in the category, it will be listed on [[Special:WantedCategories]].
* Learn how to create [[Help:Tables|Tables]]
 
  +
* Ask other users on the [[homepage:w:Special:Forum|Support Forums]]
 
  +
== What's the category page layout? ==
  +
There are several ways a category can be displayed. Anonymous or logged-out users will only be shown the dynamic, default category layout, while registered users can switch between them and select a default one.
  +
  +
You can change your preferred layout through the [[Special:Preferences|preferences page]]:
  +
* Open the '''My Info''' tab.
  +
*Scroll down to the '''Appearance''' section.
  +
*Use the drop-down next to '''Category page layout''' to select your preferred layout.
  +
*Save your preference changes.
  +
  +
You can also switch between layout options by using the layout buttons in the top-right corner of the page.
  +
  +
:''Note that the category display options do not affect the contents of the category page itself, they only affect how pages listed in the category are depicted. The category's contents (description, images, etc.) will always display first.''
  +
  +
=== Dynamic categories ===
  +
:''This is the default layout for anonymous and logged-out users.''
  +
  +
The first section is an image gallery similar to the one used by the classic categories layout. Although similar in layout, the galleries may feature different pages due to a difference in selection criteria. The gallery for dynamic categories cannot be disabled.
  +
  +
The second section contains a count of the total number of list items and a list of up to 200 items. The list contains both subcategories and pages sorted alphabetically by sortkey. The list is organized into two columns and, where possible, each item contains an image from its respective page. Above the list is a series of links that allow the viewer to skip to a specific letter in the alphabet. Below the list, next and previous buttons are displayed.
  +
  +
=== Classic categories ===
  +
The first section is a list of subcategories and the second section is a list of pages. The layout of the lists is similar to each other. If a list has no items to display, its section is not displayed. The sections contain a count of the total number of list items and a list of up to 200 items.
  +
  +
If there are more than 200 items in the list, links to view the next/previous items will be placed both above and below the list. The list is organized into as many as three columns and sorted alphabetically by sortkey. If the CategoryTree extension is enabled (it should be by default), the subcategory list will display each item as a category tree instead of a link to the category page.
   
 
== Further reading ==
 
== Further reading ==
* Read a [[homepage:w:User blog:Kirkburn/How images are picked to represent articles|review of how images are picked to represent articles]].
+
* [[w:User blog:Kirkburn/How images are picked to represent articles|How images are picked to represent articles]].
 
* [[Special:CategoryTree]] is an alternate way to display the contents of a category. The extension also adds the ability to expand subcategories on a category page, allowing you to see further subcategories. It can be transcluded in other pages. See [[mw:Extension:CategoryTree|MediaWiki]] for details.
 
* [[Special:CategoryTree]] is an alternate way to display the contents of a category. The extension also adds the ability to expand subcategories on a category page, allowing you to see further subcategories. It can be transcluded in other pages. See [[mw:Extension:CategoryTree|MediaWiki]] for details.
* [[m:Help:Category|Wikimedia's Meta-Wiki's help page on categories]] for detailed information on categories.
+
* [[m:Help:Category|Meta-Wiki's help page on categories]] for detailed information on categories.
   
 
== Further help and feedback ==
 
== Further help and feedback ==
 
{{Help and feedback section}}
 
{{Help and feedback section}}
 
 
[[ca:Ajuda:Categoria]]
 
[[ca:Ajuda:Categoria]]
 
[[de:Hilfe:Kategorien]]
 
[[de:Hilfe:Kategorien]]
Line 104: Line 123:
 
[[pt:Ajuda:Categoria]]
 
[[pt:Ajuda:Categoria]]
 
[[ru:Справка:Категории]]
 
[[ru:Справка:Категории]]
  +
[[tr:Yardım:Kategori]]
 
[[uk:Довідка:Категорії]]
 
[[uk:Довідка:Категорії]]
 
[[vi:Trợ giúp:Thể loại]]
 
[[vi:Trợ giúp:Thể loại]]

Revision as of 14:13, 3 February 2021

CategoriesUnfurled

Categories seen at the top of the page, including a view of the drop-down when you click on "more"

A category is a navigational tool used in MediaWiki to group similar pages together and structure the wiki, making it easier to explore and use. They can be used to group not only articles, but also templates, images, and even users.

Categories can be found in the article header and at the bottom of the page.

Why are categories important?

Categories are the basic tool for structuring wikis: They help organize the content, navigate the pages, and find related content. Ideally, every wiki page should be in at least one category.

Categories themselves can be categorized within other categories, allowing you to create a category tree of interlinked categories that make exploring the wiki much easier.

For example: A reader browses through a TV series wiki and opens a page on Jessica Protagonist. She is categorized as one of the Main characters. The reader can open that category and then move up to the higher level Characters category to explore Minor characters or Characters by season. The Characters category acts as the trunk of the category tree from which other categories branch off. Without the category, the reader would have to know the specific name of a character to find an article about them.

There is another reason for using categories: Categorization is essential for several core features of Fandom wikis, including:

  • The mobile main page, which uses categories as building blocks.
  • DynamicPageList, which generates lists based on categories.
  • The "Related Pages" module, which displays pages based on their categories.
  • Many bot usages.

Without categories, they simply won't work.

How to add a category?

To add a category, begin by going to the page you wish to categorize. Then use either the category module at the bottom of the page or an editor, to add your category.

Using the category module

Category Module

This is category list, located under article, where there is "Add Category" button

The category module, if enabled, allows you to add categories without opening the editor. Simply scroll down to the bottom of a page and:

  • Click on the Add category button, and start typing in a category name.
  • You can use an already-established category (suggestions will appear as you type) or add a new one.
  • Once you are done, hit save and the category will appear on the article.

If you don't use the module, you can disable it through the preferences page. Just click on the Editing tab, check the box next to Disable Category module and then save your preferences.

While editing

There are various ways to add categories while editing the wiki, depending on which editor you use.

Visual Editor and Source editor
UCP editor categorization

The editor interface.

The editor allows for switching between Source Editing and Visual Editing.

  • In Source Editing mode, you simply add the category link to the article: [[Category:Help]] will add a page to the Help category.
  • In Visual Editing mode, you can click on the Categories button in the drop-down menu on the right. This opens the category dialogue, which allows you to edit categories, add new ones, and optionally customize how the article should be sorted.

To commit changes, simply save the page.

How to sort articles in categories?

  • When clicking the edit icon next to category names, you can define a "sortkey" for that category. This sortkey defines at what point the article appears in a category page's listings, e.g., sort a first last name page under last name.
For example, you can use [[Category:Help]] to add a page to the Help category. To customize the sorting, you can use [[Category:Help|Custom name]] or [[Category:Help| ]] to force the article to display at the top of the page.
  • If an article example is an introduction for category example, a blank (space) or * (asterisk) sortkey puts it near the beginning of the category.
  • If the article is in many categories, you can add {{DEFAULTSORT:<sort key>}} in the article while editing in source editor to sort the article in all the categories the same way. This will save you from having to edit each category's parameters individually.

How to use category pages?

Categorical Pseudo-existence

When pages are in a category that hasn't been fully created

As soon as you add a category to a page, that category will appear in Special:Categories. You can reach the category page by clicking on the category link, or by entering the address into your browser.

However, the category page still needs to be created in order to be a part of the category tree, be available for selection on the Mobile Main Page, and be suggested when editing.

To do this, you need to create the category page.

Creating a category page

You can either create categories in advance, by starting a new page under the desired category name (Category:Target name) in any of our editors, or by adding the category to a page and then clicking on the category link or using Special:WantedCategories.

Category pages are created like any other page on a wiki and categorized in the same fashion.

For example, if your wiki is about the Marvel Universe, and you're starting a category about female heroes in the Marvel Cinematic Universe (aka Earth-199999), you can create the category Female superheroes (Earth-199999) in this manner:
Female superheroes of Earth-199999 came from every part of that Earth, exhibiting a wide range of powers, both meta—human and mortal. This category collects pages on this wiki about them, as well as many images and videos featuring their exploits. [[Category:Earth-19999]]

Once published, the category will appear under Earth-19999 and become available in the category module, all bots, DynamicPageList, the Help:Mobile Main Page, and other features.

Note that a category description isn't essential. However, a brief summary will always benefit your wiki's SEO, as it will be displayed in search results.

Deleting a category

Categories can be deleted like any other page, from the Edit menu drop-down panel. However, keep in mind that deleting a page does not remove it from pages contained within it. You have to delete them manually, either before or after deleting the category.

As long as a single page remains in the category, it will be listed on Special:WantedCategories.

What's the category page layout?

There are several ways a category can be displayed. Anonymous or logged-out users will only be shown the dynamic, default category layout, while registered users can switch between them and select a default one.

You can change your preferred layout through the preferences page:

  • Open the My Info tab.
  • Scroll down to the Appearance section.
  • Use the drop-down next to Category page layout to select your preferred layout.
  • Save your preference changes.

You can also switch between layout options by using the layout buttons in the top-right corner of the page.

Note that the category display options do not affect the contents of the category page itself, they only affect how pages listed in the category are depicted. The category's contents (description, images, etc.) will always display first.

Dynamic categories

This is the default layout for anonymous and logged-out users.

The first section is an image gallery similar to the one used by the classic categories layout. Although similar in layout, the galleries may feature different pages due to a difference in selection criteria. The gallery for dynamic categories cannot be disabled.

The second section contains a count of the total number of list items and a list of up to 200 items. The list contains both subcategories and pages sorted alphabetically by sortkey. The list is organized into two columns and, where possible, each item contains an image from its respective page. Above the list is a series of links that allow the viewer to skip to a specific letter in the alphabet. Below the list, next and previous buttons are displayed.

Classic categories

The first section is a list of subcategories and the second section is a list of pages. The layout of the lists is similar to each other. If a list has no items to display, its section is not displayed. The sections contain a count of the total number of list items and a list of up to 200 items.

If there are more than 200 items in the list, links to view the next/previous items will be placed both above and below the list. The list is organized into as many as three columns and sorted alphabetically by sortkey. If the CategoryTree extension is enabled (it should be by default), the subcategory list will display each item as a category tree instead of a link to the category page.

Further reading

Further help and feedback