< Wikimedia

Categories are a vital part of all wikis, especially Wikipedia. They allow users to sort pages into groups, to allow easy and comfortable navigation. To add a page to a category, one would need to link the category at the bottom of the page. Using the example of "fruit", one would write [[Category:Fruit]] at the bottom of the page to add the page to the category "Fruit".

Usage in templates

Templates can add categories automatically, especially if that is their function (for example: stubs). This is done by adding a category to the template. If the user does not want the template to be added to the category, they would write (let's use the example: Baseball players this time) <includeonly>[[Category:Baseball players]]</includeonly> at the bottom of the template's code. This will make sure, when the template is used, that only pages that transclude (use) the template will be added to that category.

This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.