Meryam Sahin (talk | contribs) Created page with "{{DISPLAYTITLE:Working with categories}} Categories are a built‑in feature of MediaWiki that help keep content organized. Each category automatically has its own index page. When you add a category tag to a page, you create a link to the category page. Clicking the link takes you to a list of all pages in the same category, making it easy to discover related content. ==How do I use categories?== Alongside namespaces, categories play an important role in organizing co..." |
Meryam Sahin (talk | contribs) No edit summary |
||
| (4 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{DISPLAYTITLE: | <status color="green" light="true">done</status> <br> | ||
Categories | {{DISPLAYTITLE:Classify pages with categories}} | ||
Categories help classify pages by shared characteristics or topics. A category works like a tag: one or more categories can be assigned to a page to make related content easier to find. <br> | |||
== | Categories are specific to each wiki. Each wiki can therefore have its own set of categories. | ||
== When to use categories == | |||
Categories are useful for grouping pages that share a characteristic or topic, regardless of their position in the page hierarchy. <br> | |||
Typical examples include: | |||
* | * topic | ||
*''' | * department | ||
*''' | * target audience | ||
* content type | |||
* project <br> | |||
Categories and subpages serve different purposes: | |||
* '''Subpages''' organize related pages into a hierarchy. | |||
== | * '''Categories''' classify pages by shared characteristics or topics. <br> | ||
A page can belong to one or more categories and can also be part of a subpage hierarchy. <br> | |||
Do not use categories to create a hierarchy of topics. Although MediaWiki technically allows hierarchical categories, this approach is not recommended. | |||
== Assign a category to a page == | |||
A category can be assigned to a page in several ways: | |||
* in the '''supplementary area''' at the bottom of the page | |||
* using '''VisualEditor''' > '''Page options''' > '''Categories''' | |||
* using '''Page tools''' > '''... all actions''' > '''Insert category''' | |||
* by entering the category directly in [[Wikitext|wikitext]]. | |||
=== In the supplementary area === | |||
The supplementary area at the bottom of a page contains the category assignments. With edit permissions, categories can be added or removed using the edit option. | |||
[[File:categories-supplementary-area.png|alt=Category assignments in the supplementary area|center|thumb|400x400px|Category assignments in the supplementary area]] | |||
=== In VisualEditor === | |||
===In the supplementary area | Categories can be added or removed while editing a page in [[Extension/VisualEditor|VisualEditor]]. | ||
The | # Open the page in VisualEditor. | ||
# Select '''Categories''' from the page options. | |||
# Add or remove categories as needed. | |||
# '''Save''' the changes. | |||
===In | [[File:visualeditor-categories-option.png|alt=Categories option in VisualEditor|center|thumb|400x400px|Categories option in VisualEditor]] | ||
=== Using page tools === | |||
Categories can also be added or removed from the page tools. | |||
[[File: | # Open the page tools. | ||
# Select '''... all actions''' > '''Insert category'''. | |||
===In wikitext=== | # Add or remove categories as needed. | ||
# '''Save''' the changes. | |||
[[File:page-tools-insert-category.png|alt=Insert category option in the page tools|center|thumb|400x400px|Insert category]] | |||
=== In wikitext === | |||
To assign a page to a category, add the following syntax to the page: | |||
<syntaxhighlight lang="text"> | <syntaxhighlight lang="text"> | ||
[[Category:Production]] | [[Category:Production]] | ||
</syntaxhighlight> | |||
The position of the category tag in the source code does not affect the category assignment. Category tags are commonly placed at the end of the page. <br> | |||
Multiple categories can be assigned to the same page: | |||
<syntaxhighlight lang="text"> | |||
[[Category:Production]] | [[Category:Production]] | ||
[[Category:Quality management]] | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Before assigning a category, check which categories already exist in the wiki. This helps avoid duplicate or similar categories. <br> | |||
For more information about categories and their syntax, see the [https://www.mediawiki.org/wiki/Help:Categories MediaWiki documentation on categories]. | |||
== Category pages == | |||
Each category has a corresponding category page. The category page lists the pages and media assigned to that category. <br> | |||
For example, assigning a page to <code>Category:Production</code> makes the page appear on the <code>Category:Production</code> category page. <br> | |||
A category can be assigned to pages even if its category page has not yet been created. The category is functional in this case, but the category page itself does not yet contain any content. | |||
: | [[File:category-page.png|alt=Category page|center|thumb|400x400px|Category page]] | ||
: | == View available categories == | ||
The special page <code>Special:Categories</code> provides a list of categories currently used in the wiki. <br> | |||
== | Select a category to open its category page. <br> | ||
A category can appear in the list even if its category page has not yet been created. In this case, the category is already assigned to pages, but no content has been added to the category page itself. | |||
== | |||
== Which pages can be categorized? == | == Which pages can be categorized? == | ||
Whether a page can be categorized depends on its content model. | Whether a page can be categorized depends on its content model. In general, pages with the <code>wikitext</code> content model can be categorized. <br> | ||
The following additional content models can also be categorized: | |||
* book | * book | ||
* FormDefinition (Extension:[[ | * FormDefinition (Extension:[[Extension/Forms|Forms]]) | ||
* BPMN (Extension:[[ | * BPMN (Extension:[[Extension/CognitiveProcessDesigner|CognitiveProcessDesigner]]) | ||
* css | * css | ||
* javascript | * javascript | ||
* json | * json | ||
* mail_template | * mail_template | ||
* pdfcreator_template (Extension:[[ | * pdfcreator_template (Extension:[[Extension/PDFCreator|PDFCreator]]) | ||
== Link directly to a category page == | |||
== | To create a link to a category page without assigning the current page to that category, add a colon before the <code>Category</code> namespace: | ||
<syntaxhighlight lang="text"> | |||
[[:Category:Production]] | |||
</syntaxhighlight> | |||
Without the initial colon, the syntax assigns the page to the category instead of creating a link to the category page. | |||
== Categories and namespaces == | |||
Categories and namespaces serve different purposes: | |||
* '''Namespaces''' provide predefined contexts for different types of content. | |||
* '''Categories''' classify content according to shared characteristics or topics. <br> | |||
Categories can contain pages from different namespaces. They do not replace namespaces. For information about organizing pages with subpages, see [[Subpage]]. | |||
[[ | |||
Latest revision as of 14:59, 26 August 2026
done
Categories help classify pages by shared characteristics or topics. A category works like a tag: one or more categories can be assigned to a page to make related content easier to find.
Categories are specific to each wiki. Each wiki can therefore have its own set of categories.
When to use categories
Categories are useful for grouping pages that share a characteristic or topic, regardless of their position in the page hierarchy.
Typical examples include:
- topic
- department
- target audience
- content type
- project
Categories and subpages serve different purposes:
- Subpages organize related pages into a hierarchy.
- Categories classify pages by shared characteristics or topics.
A page can belong to one or more categories and can also be part of a subpage hierarchy.
Do not use categories to create a hierarchy of topics. Although MediaWiki technically allows hierarchical categories, this approach is not recommended.
Assign a category to a page
A category can be assigned to a page in several ways:
- in the supplementary area at the bottom of the page
- using VisualEditor > Page options > Categories
- using Page tools > ... all actions > Insert category
- by entering the category directly in wikitext.
In the supplementary area
The supplementary area at the bottom of a page contains the category assignments. With edit permissions, categories can be added or removed using the edit option.
In VisualEditor
Categories can be added or removed while editing a page in VisualEditor.
- Open the page in VisualEditor.
- Select Categories from the page options.
- Add or remove categories as needed.
- Save the changes.
Using page tools
Categories can also be added or removed from the page tools.
- Open the page tools.
- Select ... all actions > Insert category.
- Add or remove categories as needed.
- Save the changes.
In wikitext
To assign a page to a category, add the following syntax to the page:
[[Category:Production]]
The position of the category tag in the source code does not affect the category assignment. Category tags are commonly placed at the end of the page.
Multiple categories can be assigned to the same page:
[[Category:Production]]
[[Category:Quality management]]
Before assigning a category, check which categories already exist in the wiki. This helps avoid duplicate or similar categories.
For more information about categories and their syntax, see the MediaWiki documentation on categories.
Category pages
Each category has a corresponding category page. The category page lists the pages and media assigned to that category.
For example, assigning a page to Category:Production makes the page appear on the Category:Production category page.
A category can be assigned to pages even if its category page has not yet been created. The category is functional in this case, but the category page itself does not yet contain any content.
View available categories
The special page Special:Categories provides a list of categories currently used in the wiki.
Select a category to open its category page.
A category can appear in the list even if its category page has not yet been created. In this case, the category is already assigned to pages, but no content has been added to the category page itself.
Which pages can be categorized?
Whether a page can be categorized depends on its content model. In general, pages with the wikitext content model can be categorized.
The following additional content models can also be categorized:
- book
- FormDefinition (Extension:Forms)
- BPMN (Extension:CognitiveProcessDesigner)
- css
- javascript
- json
- mail_template
- pdfcreator_template (Extension:PDFCreator)
Link directly to a category page
To create a link to a category page without assigning the current page to that category, add a colon before the Category namespace:
[[:Category:Production]]
Without the initial colon, the syntax assigns the page to the category instead of creating a link to the category page.
Categories and namespaces
Categories and namespaces serve different purposes:
- Namespaces provide predefined contexts for different types of content.
- Categories classify content according to shared characteristics or topics.
Categories can contain pages from different namespaces. They do not replace namespaces. For information about organizing pages with subpages, see Subpage.