Help:Categories - MediaWiki
文章推薦指數: 80 %
You can categorize pages and files by adding one or more Category tags to the content text. These tags create links at the bottom of the ...
Jumptocontent
Namespaces
HelpDiscussion
English
expanded
collapsed
Views
ReadViewsourceViewhistory
More
expanded
collapsed
Navigation
MainpageGetMediaWikiGetextensionsTechblogContribute
Support
UserhelpFAQTechnicalmanualSupportdeskCommunication
Development
BugtrackerCodedocsCoderepositoryStatistics
MediaWiki.org
CommunityportalRecentchangesTranslatecontentRandompageVillagepumpSandbox
Tools
WhatlinkshereRelatedchangesUploadfileSpecialpagesPermanentlinkPageinformationWikidataitem
Print/export
CreateabookDownloadasPDFPrintableversion
Inotherprojects
WikimediaCommonsMeta-WikiWikibooksWikinewsWikipediaWikiquoteWikisourceWikiversityWiktionary
Inotherlanguages
AlemannischتۆرکجهБашҡортсаBoarischБеларускаяभोजपुरीCatalàکوردیČeštinaCymraegDanskDeutschΕλληνικάEnglishEsperantoEspañolEestiEuskaraفارسیFrançaisGalegoՀայերենBahasaIndonesiaIlokanoÍslenskaItaliano日本語ភាសាខ្មែរRipoarischLëtzebuergeschमराठीBahasaMelayuNederlandsNorskਪੰਜਾਬੀPolskiپښتوPortuguêsRomânăРусскийScotsسنڌيSimpleEnglishSlovenčinaSlovenščinaShqipSvenskaதமிழ்తెలుగుTürkçeТатарча/tatarçaУкраїнськаاردوYorùbá中文Bân-lâm-gú
Editlinks
Help:Categories
Frommediawiki.org
TranslatethispageOtherlanguages:BahasaIndonesia
Bân-lâm-gú
Cymraeg
Deutsch
English
Esperanto
Ido
Interlingue
Lëtzebuergesch
Nederlands
Ripoarisch
Scots
Sunda
Taqbaylit
TiếngViệt
Türkçe
Zazaki
azərbaycanca
català
dansk
español
français
galego
isiXhosa
italiano
kurdî
latviešu
lietuvių
norskbokmål
occitan
polski
português
portuguêsdoBrasil
română
sicilianu
slovenčina
suomi
svenska
čeština
Ελληνικά
български
македонски
русский
српски/srpski
українська
ייִדיש
עברית
العربية
سنڌي
فارسی
پښتو
کوردی
अंगिका
अवधी
हिन्दी
বাংলা
ਪੰਜਾਬੀ
മലയാളം
ไทย
ဖၠုံလိက်
ဘာသာမန်
中文
日本語
한국어
Note:Whenyoueditthispage,youagreetoreleaseyourcontributionundertheCC0.SeePublicDomainHelpPagesformoreinfo.
Translate
Categories,asoftwarefeatureofMediaWiki,provideautomaticindexesthatareusefulastablesofcontents.
YoucancategorizepagesandfilesbyaddingoneormoreCategorytagstothecontenttext.Thesetagscreatelinksatthebottomofthepagethattakeyoutothelistofallpagesinthatcategory,whichmakesiteasytobrowserelatedarticles.
Contents
1Summary
2Addingapagetoacategory
2.1Sortkey
3Creatingacategorypage
4Managingthecategoryhierarchy
4.1Categorytree
5Hiddencategories
6Linkingtoacategory
7Categoriesandtemplates(transcludedpages)
8Redirectingacategory
9Trackingcategories
10Renamingacategory
11Seealso
Summary
EachofthepagesintheCategorynamespacerepresentsaso-calledcategory,agroupingofrelatedpages,andcontainsanindexforthepagesofitscategory.Forexample,thispagebelongsto"Category:Help".Ifyouopenthecategorypage,youwillseealinktothispagethere.
Whenapagebelongstooneormorecategories,thesecategoriesappearatthebottomofthepage(orintheupper-rightcorner,dependingontheskinbeingused).
Thecategorypagesthemselvescontain2parts:
attheirbeginning,anoptionalpartmaycontaintextthatcanbeedited,likeanyotherpage,
attheirend,aneverpresent,automaticallygenerated,alphabeticallistofallpagesinthatcategory,intheformoflinks.Infact,intheUnicodesortorder.
Toassignacategorytoapage,simplyaddthelink"[[Category:Categoryname]]"tothepage'swikitext.Theusualplacetoadditisatthebottomofthepage.
Tolinkacategorypagewithinapageasanormalwikilink(withoutaddingthepagetothecategory),prefixthelinknamewithacolon.Forexample:[[:Category:Notinthiscategory]]
Anewcategorycanbecreatedbeforeassigninganypagetoit,inthesamewayasanyotherregularpage.
Individualwikismayhavetheirowntop-levelcategories,suchasCategory:ContentsonWikipedia.
Foracompletelistofallcategorieswhichhaveatleastonepage,seeSpecial:Categories.
Foracompletelistofallcreated/editedcategories,includingtheonesthatdon'thaveanypages,seeSpecial:Allpages/Category:(notethecolonattheend).
Addingapagetoacategory
Toaddapageoruploadedfiletoacategory,simplyeditthepageandaddthefollowingtext(whereNameisthenameofthecategoryyouwanttoadditto).
[[Category:Name]]
AnynumberofCategorytagsmaybeaddedtothepageandthepagewillbelistedinallofthem.Categorytags,alongwithinterwikilanguagelinksplacedinthesidebar,areusuallyaddedattheverybottomofthepagefortheconvenienceofothereditors.
Onacategorizedpage,categoriesaredisplayedintheCategories:boxstrictlyintheordertheyappearinthewikitext.
If$wgUseCategoryBrowserissettotrue,underthefirstlisteachcategoryislistedagain,breadcrumb-style,withallitsparentcategories,sortedalphabetically.
(AtleastinMediaWiki1.18.2)ifacategoryisasubcategoryofmorethanoneparent,bothhierarchieswillbelisted,butthetaggedcategorywillbestrippedoffallbutoneofthese.
Thiscreatesthepotentialforwhatappeartobeduplicateentriesifacategorywithmultipleparentsandoneofitsparentsarebothtaggedonapage.
ForexamplesupposeMaryanneisasubcategoryofbothMaryandAnne.
IfapagetagscategoriesMaryanneandAnnethentheCategorybreadcrumbswillshow
Anne
Anne
Mary->Maryanne
"Anne"appearstobeduplicated,butwhatismeantis
Anne
Anne->Maryanne
Mary->Maryanne
Thisisabug,andhasbeenreportedinphab:T35614.
Sortkey
Bydefault,apageissortedwithinacategoryunderthefirstletterofitsname—withoutthenamespace.
Also,MediaWikigroupsaccentedcharactersseparatelyfromtheirunaccentedversion,sopagesstartingbyÀ,Á,Ä,willbelistedunderseparateheadings,insteadofunderheadingA.
(Ifyouhaveshellaccess,thesedefaultscanbechangedusing$wgCategoryCollation.)
Asortkeyspecifiesunderwhichletterheading,andwhereinthecategorylist,thepagewillappear.Youcanaddasortkeybyplacingitinsidethetagafterapipecharacter.Forexample,thetagbelowwilladdthepageunderheading"S".
[[Category:Name|Sort]]
Whetherornotsortkeysarecase-sensitivedependsonyourconfigurationsettings.
TheorderofthesectionswithinacategoryfollowstheUnicodesortorder.Thesortkeydoesnotchangethepagetitledisplayedinthecategory.
Spacesandothercharactersareperfectlyvalid.
SeeHelp:Sortingforfurtherinformationoncategorysorting.
Creatingacategorypage
Categoriesexisteveniftheirpagehasnotbeencreated,butthesecategoriesareisolatedfromothersandservelittlepurposefororganizationornavigation.
AcategoryiscreatedbycreatingapageintheCategory:namespace.Acategorypagecanbecreatedthesamewayasotherwikipages(seeHelp:Startinganewpage);justadd"Category:"beforethepagetitle.
Toavoidextrawork,trysearchingwithinyourwikibeforecreatinganewcategory.Thelistofallcategoriescanbefoundin"Specialpages"inthe"tools"boxofthesidebar.
Managingthecategoryhierarchy
Categoriesmaybelongtoothercategoriesinahierarchy.Sincecategorypagesaremuchlikeanyotherpage,aCategorytagmaybeaddedtothebottomofacategorypage.
Itisagoodideatoorganizeallcategoriesintoahierarchywithasingletoplevelcategory.Thecategorystructurecantaketheformofatreewithseparatebranches,butmoreoftenwillhaveagraphstructure.Generally,thereshouldbeacontiguouschainofparent-childlinksbetweeneachcategoryandthetoplevelcategory.
Categorytree
Mainpage:CategoryTreeextensionmanual
SinceMediaWiki 1.31,CategoryTreeextensionispackagedbydefault,allowingSpecial:CategoryTreeand
延伸文章資訊
- 1Wikipedia:FAQ/Categorization
To make a list of articles, you edit the list directly; but to place articles into a category, yo...
- 2Wikipedia:Categorization
- 3Help:Category - Wiktionary
How to add pages to categories
- 4Help:Categories - MediaWiki
You can categorize pages and files by adding one or more Category tags to the content text. These...
- 5Commons:How to create new categories or subcategories
Note: See Commons:Categories#Creating a new category for more info. This is the short version. Ho...